@@ -64,6 +64,9 @@ Just like in iterator methods, there are several restrictions on where a yield s
An asynchronous `using` is lowered just like a regular `using`, except that `Dispose()` is replaced with `await DisposeAsync()`.
Note that pattern-based lookup for `DisposeAsync` binds to instance methods that can be invoked without arguments.
Extension methods do not contribute. The result of `DisposeAsync` must be awaitable.
### Detailed design for `await foreach` statement
An `await foreach` is lowered just like a regular `foreach`, except that:
...
...
@@ -71,8 +74,9 @@ An `await foreach` is lowered just like a regular `foreach`, except that:
-`MoveNext()` is replaced with `await MoveNextAsync()`
-`Dispose()` is replaced with `await DisposeAsync()`
Note that pattern-based lookup for `GetAsyncEnumerator` and `MoveNextAsync` do not place particular requirements on those methods,
as long as they could be invoked without arguments.
Note that pattern-based lookup for `GetAsyncEnumerator`, `MoveNextAsync` and `DisposeAsync` binds to instance methods that can be invoked without arguments.
Extension methods do not contribute. The result of `MoveNextAsync` and `DisposeAsync` must be awaitable.
Disposal for `await foreach` does not include a fallback to a runtime check for an interface implementation.
Asynchronous foreach loops are disallowed on collections of type dynamic,
as there is no asynchronous equivalent of the non-generic `IEnumerable` interface.
@@ -7234,7 +7234,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to '{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'.
/// Looks up a localized string similar to '{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method..
/// </summary>
internal static string ERR_NoConvToIAsyncDisp {
get {
...
...
@@ -7243,7 +7243,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to '{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?.
/// Looks up a localized string similar to '{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?.
@@ -7252,7 +7252,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to '{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'..
/// Looks up a localized string similar to '{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method..
/// </summary>
internal static string ERR_NoConvToIDisp {
get {
...
...
@@ -7261,7 +7261,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to '{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?.
/// Looks up a localized string similar to '{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?.
@@ -2981,16 +2981,16 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<value>Anonymous methods, lambda expressions, and query expressions inside structs cannot access instance members of 'this'. Consider copying 'this' to a local variable outside the anonymous method, lambda expression or query expression and using the local instead.</value>
<value>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</value>
<value>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</value>
<value>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</value>
<value>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</value>
<value>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</value>
<value>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</value>
</data>
<dataname="ERR_BadParamRef"xml:space="preserve">
<value>Parameter {0} must be declared with the '{1}' keyword</value>
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Collections.Immutable;
usingSystem.Diagnostics;
usingMicrosoft.CodeAnalysis.CSharp.Symbols;
usingMicrosoft.CodeAnalysis.CSharp.Syntax;
usingMicrosoft.CodeAnalysis.PooledObjects;
namespaceMicrosoft.CodeAnalysis.CSharp
{
...
...
@@ -182,11 +180,10 @@ private BoundStatement RewriteEnumeratorForEachStatement(BoundForEachStatement n
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'{0} neimplementuje vzorek {1}. {2} nemá správný podpis.</target>
<target state="needs-review-translation">'{0} neimplementuje vzorek {1}. {2} nemá správný podpis.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Typ neimplementuje vzorek kolekce. Člen nemá správný podpis.</target>
<target state="needs-review-translation">Typ neimplementuje vzorek kolekce. Člen nemá správný podpis.</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Blok catch() po bloku catch (System.Exception e) může zachytit výjimky, kter
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}: Typ použitý v příkazu using musí být implicitně převeditelný na System.IDisposable.</target>
<note />
</trans-unit>
...
...
@@ -9457,8 +9457,8 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'"{0}" implementiert das Muster "{1}" nicht. "{2}" weist die falsche Signatur auf.</target>
<target state="needs-review-translation">'"{0}" implementiert das Muster "{1}" nicht. "{2}" weist die falsche Signatur auf.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Der Typ implementiert nicht das Sammlungsmuster. Das Element weist die falsche Signatur auf.</target>
<target state="needs-review-translation">Der Typ implementiert nicht das Sammlungsmuster. Das Element weist die falsche Signatur auf.</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Ein catch()-Block nach einem catch (System.Exception e)-Block kann nicht-CLS-Aus
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'"{0}": Der in einer using-Anweisung verwendete Typ muss implizit in System.IDisposable konvertiert werden können.</target>
<note />
</trans-unit>
...
...
@@ -9470,8 +9470,8 @@ Um die Warnung zu beheben, können Sie stattdessen /reference verwenden (Einbett
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'{0}' no implementa el patrón '{1}'. '{2}' tiene una firma incorrecta.</target>
<target state="needs-review-translation">'{0}' no implementa el patrón '{1}'. '{2}' tiene una firma incorrecta.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">El tipo no implementa la trama de colección. El miembro tiene la firma incorrecta</target>
<target state="needs-review-translation">El tipo no implementa la trama de colección. El miembro tiene la firma incorrecta</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Un bloque catch() después de un bloque catch (System.Exception e) puede abarcar
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}': el tipo usado en una instrucción using debe poder convertirse implícitamente en 'System.IDisposable'</target>
<note />
</trans-unit>
...
...
@@ -9444,8 +9444,8 @@ Para eliminar la advertencia puede usar /reference (establezca la propiedad Embe
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'{0}' n'implémente pas le modèle '{1}'. '{2}' a une signature erronée.</target>
<target state="needs-review-translation">'{0}' n'implémente pas le modèle '{1}'. '{2}' a une signature erronée.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Un type n'implémente pas le modèle de la collection ; un membre n'a pas la bonne signature</target>
<target state="needs-review-translation">Un type n'implémente pas le modèle de la collection ; un membre n'a pas la bonne signature</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Un bloc catch() après un bloc catch (System.Exception e) peut intercepter des e
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}' : le type utilisé dans une instruction using doit être implicitement convertible en 'System.IDisposable'</target>
<note />
</trans-unit>
...
...
@@ -9445,8 +9445,8 @@ Pour supprimer l'avertissement, vous pouvez utiliser la commande /reference (dé
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'{0}' non implementa il modello '{1}'. La firma di '{2}' è errata.</target>
<target state="needs-review-translation">'{0}' non implementa il modello '{1}'. La firma di '{2}' è errata.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Il tipo non implementa il modello di raccolta. La firma del membro è errata</target>
<target state="needs-review-translation">Il tipo non implementa il modello di raccolta. La firma del membro è errata</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Un blocco catch() dopo un blocco catch (System.Exception e) è in grado di rilev
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}': il tipo usato in un'istruzione using deve essere convertibile in modo implicito in 'System.IDisposable'</target>
<note />
</trans-unit>
...
...
@@ -9446,8 +9446,8 @@ Per rimuovere l'avviso, è invece possibile usare /reference (impostare la propr
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}': using ステートメントで使用される型は、暗黙的に 'System.IDisposable' への変換が可能でなければなりません。</target>
<note />
</trans-unit>
...
...
@@ -9470,8 +9470,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
@@ -5571,7 +5571,7 @@ catch (System.Exception e) 블록 뒤의 catch() 블록은 RuntimeCompatibilityA
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}': using 문에 사용된 형식은 암시적으로 'System.IDisposable'로 변환할 수 있어야 합니다.</target>
<note />
</trans-unit>
...
...
@@ -9470,8 +9470,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'Element „{0}” nie implementuje wzorca „{1}”. Element „{2}” ma nieprawidłową sygnaturę.</target>
<target state="needs-review-translation">'Element „{0}” nie implementuje wzorca „{1}”. Element „{2}” ma nieprawidłową sygnaturę.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Typ nie zawiera implementacji wzorca kolekcji; składowa ma niewłaściwą sygnaturę</target>
<target state="needs-review-translation">Typ nie zawiera implementacji wzorca kolekcji; składowa ma niewłaściwą sygnaturę</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Blok catch() po bloku catch (System.Exception e) może przechwytywać wyjątki n
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'„{0}”: musi istnieć możliwość niejawnego przekonwertowania typu użytego w instrukcji using na interfejs „System.IDisposable”</target>
<note />
</trans-unit>
...
...
@@ -9449,8 +9449,8 @@ Aby usunąć ostrzeżenie, możesz zamiast tego użyć opcji /reference (ustaw w
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'"{0}" não implementa o padrão "{1}". "{2}" tem a assinatura errada.</target>
<target state="needs-review-translation">'"{0}" não implementa o padrão "{1}". "{2}" tem a assinatura errada.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">O tipo não implementa o padrão de coleção; o membro possui a assinatura incorreta</target>
<target state="needs-review-translation">O tipo não implementa o padrão de coleção; o membro possui a assinatura incorreta</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ Um bloco catch() depois de um bloco catch (System.Exception e) poderá capturar
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'"{0}": tipo usado em uma instrução using deve ser implicitamente conversível para "System. IDisposable"</target>
<note />
</trans-unit>
...
...
@@ -9450,8 +9450,8 @@ Para incorporar informações de tipo de interoperabilidade para os dois assembl
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'"{0}" не реализует шаблон "{1}". "{2}" имеет неправильную сигнатуру.</target>
<target state="needs-review-translation">'"{0}" не реализует шаблон "{1}". "{2}" имеет неправильную сигнатуру.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Тип не реализует шаблон коллекции: член содержит неправильную подпись</target>
<target state="needs-review-translation">Тип не реализует шаблон коллекции: член содержит неправильную подпись</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}": тип, использованный в операторе using, должен иметь неявное преобразование в System.IDisposable.</target>
<note />
</trans-unit>
...
...
@@ -9452,8 +9452,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<target state="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}' does not implement the '{1}' pattern. '{2}' has the wrong signature.</source>
<target state="translated">'{0}', '{1}' kalıbını uygulamaz. '{2}' yanlış imzaya sahip.</target>
<target state="needs-review-translation">'{0}', '{1}' kalıbını uygulamaz. '{2}' yanlış imzaya sahip.</target>
<note />
</trans-unit>
<trans-unit id="WRN_PatternBadSignature_Title">
<source>Type does not implement the collection pattern; member has the wrong signature</source>
<target state="translated">Tür koleksiyon desenini uygulamaz; üye yanlış imzaya sahip</target>
<target state="needs-review-translation">Tür koleksiyon desenini uygulamaz; üye yanlış imzaya sahip</target>
<note />
</trans-unit>
<trans-unit id="ERR_FriendRefNotEqualToThis">
...
...
@@ -5571,7 +5571,7 @@ RuntimeCompatibilityAttribute AssemblyInfo.cs dosyasında false olarak ayarlanm
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<target state="needs-review-translation">'{0}': bir using deyiminde kullanılan tür açıkça 'System.IDisposable' öğesine dönüştürülebilir olmalıdır</target>
<note />
</trans-unit>
...
...
@@ -9458,8 +9458,8 @@ Uyarıyı kaldırmak için, /reference kullanabilirsiniz (Birlikte Çalışma T
<note />
</trans-unit>
<trans-unit id="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<target state="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<targetstate="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<targetstate="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
@@ -5571,7 +5571,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<targetstate="needs-review-translation">'“{0}”: using 语句中使用的类型必须可隐式转换为“System.IDisposable”</target>
<note/>
</trans-unit>
...
...
@@ -9470,8 +9470,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'. Did you mean 'using' rather than 'await using'?</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method. Did you mean 'using' rather than 'await using'?</target>
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIDispWrongAsync">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</source>
<targetstate="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'. Did you mean 'await using' rather than 'using'?</target>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</source>
<targetstate="new">'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method. Did you mean 'await using' rather than 'using'?</target>
@@ -5571,7 +5571,7 @@ A catch() block after a catch (System.Exception e) block can catch non-CLS excep
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIDisp">
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable'.</source>
<source>'{0}': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.</source>
<targetstate="needs-review-translation">'{0}': 在 using 陳述式中所用的類型,必須可以隱含轉換成 'System.IDisposable'。</target>
<note/>
</trans-unit>
...
...
@@ -9470,8 +9470,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note/>
</trans-unit>
<trans-unitid="ERR_NoConvToIAsyncDisp">
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable'</target>
<source>'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</source>
<targetstate="new">'{0}': type used in an async using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.</target>
public DisposableEnumerator GetEnumerator() { return new DisposableEnumerator(); }
}
ref struct DisposableEnumerator
{
int x;
public int Current { get { return x; } }
public bool MoveNext() { return ++x < 4; }
}
static class DisposeExtension1
{
public static void Dispose(this DisposableEnumerator de) => throw null;
}
static class DisposeExtension2
{
public static void Dispose(this DisposableEnumerator de) => throw null;
}
";
// extension methods do not contribute to disposal
CompileAndVerify(source,expectedOutput:@"123");
}
[Fact]
...
...
@@ -1535,7 +1569,7 @@ static void Main()
{
foreach (var x in new Enumerable1())
{
System.Console.WriteLine(x);
System.Console.Write(x);
}
}
}
...
...
@@ -1554,17 +1588,11 @@ class Enumerable1
static class DisposeExtension
{
public static void Dispose(this DisposableEnumerator de, int arg = 4) { System.Console.WriteLine($""Done with DisposableEnumerator. arg was {arg}""); }
public static void Dispose(this DisposableEnumerator de, int arg = 4) => throw null;
// extension methods do not contribute to disposal
CompileAndVerify(source,expectedOutput:@"123");
}
[Fact]
...
...
@@ -1577,7 +1605,7 @@ static void Main()
{
foreach (var x in new Enumerable1())
{
System.Console.WriteLine(x);
System.Console.Write(x);
}
}
}
...
...
@@ -1596,17 +1624,11 @@ class Enumerable1
static class DisposeExtension
{
public static void Dispose(this DisposableEnumerator de, params object[] args) { System.Console.WriteLine($""Done with DisposableEnumerator. Args was {args}, length {args.Length}""); }
public static void Dispose(this DisposableEnumerator de, params object[] args) => throw null;
// (17,13): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using S1 s1 = new S1();
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"using S1 s1 = new S1();").WithArguments("S1").WithLocation(17,13)
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// (15,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(15,16),
// (19,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// (16,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(16,16),
// (20,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// Extension methods should just be ignored, rather than rejected after-the-fact. So there should be no error about ambiguities
// Tracked by https://github.com/dotnet/roslyn/issues/32767
CreateCompilation(source).VerifyDiagnostics(
// (20,16): error CS0121: The call is ambiguous between the following methods or properties: 'C2.Dispose(S1)' and 'C3.Dispose(S1)'
// using (S1 c = new S1())
...
...
@@ -445,7 +462,7 @@ public void UsingPatternScopedExtensionMethodTest()
namespace N1
{
static class C2
static class C2
{
public static void Dispose(this S1 s1) { }
}
...
...
@@ -453,7 +470,7 @@ static class C2
namespace N2
{
static class C3
static class C3
{
public static void Dispose(this S1 s1) { }
}
...
...
@@ -461,7 +478,7 @@ static class C3
namespace N3
{
static class C4
static class C4
{
public static int Dispose(this S1 s1) { return 0; }
}
...
...
@@ -474,7 +491,7 @@ partial class C5
{
static void M()
{
using (S1 s = new S1()) // error 1: no extension in scope
using (S1 s = new S1()) // error 1
{
}
}
...
...
@@ -487,7 +504,7 @@ partial class C5
{
static void M2()
{
using (S1 s = new S1()) // success: resolve against C2.Dispose
using (S1 s = new S1()) // error 2
{
}
}
...
...
@@ -500,7 +517,7 @@ partial class C5
{
static void M3()
{
using (S1 s = new S1()) // error 2: C4.Dispose does not match pattern
using (S1 s = new S1()) // error 3
{
}
}
...
...
@@ -514,7 +531,7 @@ partial class C5
{
static void M4()
{
using (S1 s = new S1()) // error 3: C2.Dispose and C4.Dispose are ambiguous
using (S1 s = new S1()) // error 4
{
}
}
...
...
@@ -529,7 +546,7 @@ partial class C5
{
static void M5()
{
using (S1 s = new S1()) // error 4: C4.Dispose does not match pattern
using (S1 s = new S1()) // error 5
{
}
}
...
...
@@ -542,36 +559,39 @@ partial class C5
{
static void M6()
{
using (S1 s = new S1()) // success: resolve against C2.Dispose
{
using (S1 s = new S1()) // error 6
{
}
}
}
}
}
}";
// Extension methods should just be ignored, rather than rejected after-the-fact. So there should be no error about ambiguities
// Tracked by https://github.com/dotnet/roslyn/issues/32767
CreateCompilation(source).VerifyDiagnostics(
// (37,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable'.
// using (S1 s = new S1()) // error 1: no extension in scope
// (37,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 1
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(37,20),
// (63,20): warning CS0280: 'S1' does not implement the 'disposable' pattern. 'C4.Dispose(S1)' has the wrong signature.
// using (S1 s = new S1()) // error 2: C4.Dispose does not match pattern
Diagnostic(ErrorCode.WRN_PatternBadSignature,"S1 s = new S1()").WithArguments("S1","disposable","N3.C4.Dispose(S1)").WithLocation(63,20),
// (63,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable'.
// using (S1 s = new S1()) // error 2: C4.Dispose does not match pattern
// (50,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 2
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(50,20),
// (63,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 3
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(63,20),
// (77,20): error CS0121: The call is ambiguous between the following methods or properties: 'N1.C2.Dispose(S1)' and 'N3.C4.Dispose(S1)'
// using (S1 s = new S1()) // error 3: C2.Dispose and C4.Dispose are ambiguous
// using (S1 s = new S1()) // error 4
Diagnostic(ErrorCode.ERR_AmbigCall,"S1 s = new S1()").WithArguments("N1.C2.Dispose(S1)","N3.C4.Dispose(S1)").WithLocation(77,20),
// (77,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable'.
// using (S1 s = new S1()) // error 3: C2.Dispose and C4.Dispose are ambiguous
// (77,20): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 4
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(77,20),
// (92,24): warning CS0280: 'S1' does not implement the 'disposable' pattern. 'C4.Dispose(S1)' has the wrong signature.
// using (S1 s = new S1()) // error 4: C4.Dispose does not match pattern
Diagnostic(ErrorCode.WRN_PatternBadSignature,"S1 s = new S1()").WithArguments("S1","disposable","N3.C4.Dispose(S1)").WithLocation(92,24),
// (92,24): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable'.
// using (S1 s = new S1()) // error 4: C4.Dispose does not match pattern
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(92,24)
// (92,24): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 5
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(92,24),
// (105,28): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1()) // error 6
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(105,28)
);
}
...
...
@@ -612,7 +632,20 @@ static void Main()
using (s2b) { }
}
}";
CreateCompilation(source).VerifyDiagnostics();
CreateCompilation(source).VerifyDiagnostics(
// (22,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(22,16),
// (26,16): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// (28,16): error CS1674: 'S2': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S2 s = new S2())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S2 s = new S2()").WithArguments("S2").WithLocation(28,16),
// (32,16): error CS1674: 'S2': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// Extension methods should just be ignored, rather than rejected after-the-fact. So there should be no error about ambiguities
// Tracked by https://github.com/dotnet/roslyn/issues/32767
CreateCompilation(source).VerifyDiagnostics(
// (21,15): error CS0121: The call is ambiguous between the following methods or properties: 'C2.Dispose(S1, int)' and 'C3.Dispose(S1, int)'
// using (S1 s = new S1())
...
...
@@ -677,7 +713,14 @@ static void Main()
using (s1b) { }
}
}";
CreateCompilation(source).VerifyDiagnostics();
CreateCompilation(source).VerifyDiagnostics(
// (15,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(15,15),
// (19,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// (16,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(16,15)
);
}
[Fact]
...
...
@@ -766,7 +813,14 @@ static void Main()
using (s1b) { }
}
}";
CreateCompilation(source).VerifyDiagnostics();
CreateCompilation(source).VerifyDiagnostics(
// (15,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(15,15),
// (19,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// (15,15): error CS1674: 'S1': type used in a using statement must be implicitly convertible to 'System.IDisposable' or implement a suitable 'Dispose' method.
// using (S1 s = new S1())
Diagnostic(ErrorCode.ERR_NoConvToIDisp,"S1 s = new S1()").WithArguments("S1").WithLocation(15,15)