diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs index c71c28821cff9..19e3505db39fe 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs @@ -6593,15 +6593,6 @@ protected BoundExpression BindClassCreationExpression( ReportMemberNotSupportedByDynamicDispatch(node, finalApplicableCandidates[0], analyzedArguments.Arguments, diagnostics); } - if (finalApplicableCandidates.Length != 1 && - Compilation.LanguageVersion > LanguageVersion.CSharp12 && // The following check (while correct) is redundant otherwise - HasApplicableMemberWithPossiblyExpandedNonArrayParamsCollection(analyzedArguments.Arguments, finalApplicableCandidates)) - { - Error(diagnostics, - ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, - node); - } - var argArray = BuildArgumentsForDynamicInvocation(analyzedArguments, diagnostics); var refKindsArray = analyzedArguments.RefKinds.ToImmutableOrNull(); @@ -9712,15 +9703,6 @@ private BoundExpression BindIndexerOrIndexedPropertyAccess( ReportMemberNotSupportedByDynamicDispatch(syntax, finalApplicableCandidates[0], analyzedArguments.Arguments, diagnostics); } - if (finalApplicableCandidates.Length != 1 && - Compilation.LanguageVersion > LanguageVersion.CSharp12 && // The following check (while correct) is redundant otherwise - HasApplicableMemberWithPossiblyExpandedNonArrayParamsCollection(analyzedArguments.Arguments, finalApplicableCandidates)) - { - Error(diagnostics, - ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, - syntax); - } - overloadResolutionResult.Free(); return BindDynamicIndexer(syntax, receiver, analyzedArguments, finalApplicableCandidates.SelectAsArray(r => r.Member), diagnostics); } diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs index 8a32d3821bb6f..57ddd7e102427 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs @@ -668,22 +668,6 @@ private static bool HasApplicableConditionalMethod(ImmutableArray(ArrayBuilder arguments, ImmutableArray> finalApplicableCandidates) - where TMember : Symbol - { - foreach (var candidate in finalApplicableCandidates) - { - if ((candidate.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm || - IsAmbiguousDynamicParamsArgument(arguments, candidate, argumentSyntax: out _)) && - !candidate.Member.GetParameters().Last().Type.IsSZArray()) - { - return true; - } - } - - return false; - } - private void ReportMemberNotSupportedByDynamicDispatch(SyntaxNode syntax, MemberResolutionResult candidate, ArrayBuilder arguments, BindingDiagnosticBag diagnostics) where TMember : Symbol { @@ -838,7 +822,7 @@ private BoundExpression BindMethodGroupInvocation( } else { - ReportDynamicInvocationWarnings(syntax, methodGroup, diagnostics, resolution, finalApplicableCandidates); + ReportDynamicInvocationWarnings(syntax, methodGroup, diagnostics, finalApplicableCandidates); result = BindDynamicInvocation(syntax, methodGroup, resolution.AnalyzedArguments, finalApplicableCandidates.SelectAsArray(r => r.Member), diagnostics, queryClause); } @@ -860,7 +844,7 @@ private BoundExpression BindMethodGroupInvocation( return result; } - private void ReportDynamicInvocationWarnings(SyntaxNode syntax, BoundMethodGroup methodGroup, BindingDiagnosticBag diagnostics, MethodGroupResolution resolution, ImmutableArray> finalApplicableCandidates) + private void ReportDynamicInvocationWarnings(SyntaxNode syntax, BoundMethodGroup methodGroup, BindingDiagnosticBag diagnostics, ImmutableArray> finalApplicableCandidates) { if (HasApplicableConditionalMethod(finalApplicableCandidates)) { @@ -868,15 +852,6 @@ private void ReportDynamicInvocationWarnings(SyntaxNode syntax, BoundMethodGroup // because one or more applicable overloads are conditional methods Error(diagnostics, ErrorCode.WRN_DynamicDispatchToConditionalMethod, syntax, methodGroup.Name); } - - if (finalApplicableCandidates.Length != 1 && - Compilation.LanguageVersion > LanguageVersion.CSharp12 && // The following check (while correct) is redundant otherwise - HasApplicableMemberWithPossiblyExpandedNonArrayParamsCollection(resolution.AnalyzedArguments.Arguments, finalApplicableCandidates)) - { - Error(diagnostics, - ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, - syntax, methodGroup.Name); - } } private bool IsAmbiguousDynamicParamsArgument(ArrayBuilder arguments, MemberResolutionResult candidate, out SyntaxNode argumentSyntax) diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx index ae0dca2209f86..a80bb7e8a1161 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.resx +++ b/src/Compilers/CSharp/Portable/CSharpResources.resx @@ -7860,24 +7860,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ Ambiguity between expanded and normal forms of non-array params collection parameter of '{0}', the only corresponding argument has the type 'dynamic'. Consider casting the dynamic argument. - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Creation of params collection '{0}' results in an infinite chain of invocation of constructor '{1}'. diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs index ffbcd5ca6982e..f325c2ee936d5 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs @@ -2290,9 +2290,9 @@ internal enum ErrorCode ERR_DynamicDispatchToParamsCollection = 9218, ERR_ParamsCollectionAmbiguousDynamicArgument = 9219, - WRN_DynamicDispatchToParamsCollectionMethod = 9220, - WRN_DynamicDispatchToParamsCollectionIndexer = 9221, - WRN_DynamicDispatchToParamsCollectionConstructor = 9222, + // available 9220, + // available 9221, + // available 9222, ERR_ParamsCollectionInfiniteChainOfConstructorCalls = 9223, ERR_ParamsMemberCannotBeLessVisibleThanDeclaringMember = 9224, ERR_ParamsCollectionConstructorDoesntInitializeRequiredMember = 9225, diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs b/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs index 81f28be3dc25a..d0f35f8e1a8bc 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorFacts.cs @@ -558,9 +558,6 @@ internal static int GetWarningLevel(ErrorCode code) case ErrorCode.WRN_CollectionExpressionRefStructMayAllocate: case ErrorCode.WRN_CollectionExpressionRefStructSpreadMayAllocate: case ErrorCode.WRN_ConvertingLock: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor: case ErrorCode.WRN_PartialPropertySignatureDifference: return 1; @@ -2423,9 +2420,6 @@ or ErrorCode.ERR_CollectionExpressionMissingAdd or ErrorCode.WRN_ConvertingLock or ErrorCode.ERR_DynamicDispatchToParamsCollection or ErrorCode.ERR_ParamsCollectionAmbiguousDynamicArgument - or ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod - or ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer - or ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor or ErrorCode.ERR_ParamsCollectionInfiniteChainOfConstructorCalls or ErrorCode.ERR_ParamsMemberCannotBeLessVisibleThanDeclaringMember or ErrorCode.ERR_ParamsCollectionConstructorDoesntInitializeRequiredMember diff --git a/src/Compilers/CSharp/Portable/Generated/ErrorFacts.Generated.cs b/src/Compilers/CSharp/Portable/Generated/ErrorFacts.Generated.cs index afb400cd8e6ed..7c0efab349716 100644 --- a/src/Compilers/CSharp/Portable/Generated/ErrorFacts.Generated.cs +++ b/src/Compilers/CSharp/Portable/Generated/ErrorFacts.Generated.cs @@ -338,9 +338,6 @@ public static bool IsWarning(ErrorCode code) case ErrorCode.WRN_CollectionExpressionRefStructMayAllocate: case ErrorCode.WRN_CollectionExpressionRefStructSpreadMayAllocate: case ErrorCode.WRN_ConvertingLock: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor: case ErrorCode.WRN_BadYieldInLock: case ErrorCode.WRN_PartialPropertySignatureDifference: return true; diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf index b4496f40ad555..61a1a5f35d074 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf @@ -2872,36 +2872,6 @@ Odkaz analyzátoru byl zadán vícekrát - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení konstruktoru s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení konstruktoru s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení indexeru s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení indexeru s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení metody{0} s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno nebo více přetížení metody s parametrem kolekce parametrů mimo pole může být použitelné pouze v rozbalené podobě, která není během dynamického odesílání podporována. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Použití výsledku {0} v tomto kontextu může vystavit proměnné, na které odkazuje parametr {1}, mimo rozsah jejich oboru. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf index 5955194f47c0e..22d3090b57e4b 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf @@ -2872,36 +2872,6 @@ Mehrfacher Verweis auf Analysetool - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Mindestens eine Konstruktorüberladung mit nicht arraybasierten Params-Auflistungsparametern kann nur in erweiterter Form anwendbar sein, was während der dynamischen Verteilung nicht unterstützt wird. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Mindestens eine Konstruktorüberladung mit nicht arraybasierten Params-Auflistungsparametern kann nur in erweiterter Form anwendbar sein, was während der dynamischen Verteilung nicht unterstützt wird. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Eine oder mehrere Indexerüberladungen mit nicht arraybasierten Params-Auflistungsparametern sind möglicherweise nur in erweiterter Form anwendbar, was während der dynamischen Verteilung nicht unterstützt wird. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Eine oder mehrere Indexerüberladungen mit nicht arraybasierten Params-Auflistungsparametern sind möglicherweise nur in erweiterter Form anwendbar, was während der dynamischen Verteilung nicht unterstützt wird. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Eine oder mehrere Überladungen der Methode "{0}" mit nicht arraybasierten Params-Auflistungsparametern sind möglicherweise nur in erweiterter Form anwendbar, was während der dynamischen Verteilung nicht unterstützt wird. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Eine oder mehrere Überladungen der Methode mit nicht arraybasierten Params-Auflistungsparametern sind möglicherweise nur in erweiterter Form anwendbar, was während der dynamischen Verteilung nicht unterstützt wird. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Durch die Verwendung des Ergebnisses von "{0}" in diesem Kontext können vom Parameter "{1}" referenzierte Variablen außerhalb ihres Deklarationsbereichs verfügbar gemacht werden. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf index 62cb1ec285d24..1a5bd7a3bdc57 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf @@ -2872,36 +2872,6 @@ Referencia del analizador especificada varias veces - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o más sobrecargas del constructor que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o más sobrecargas del constructor que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o más sobrecargas del indexador que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o más sobrecargas del indexador que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o varias sobrecargas del método "{0}" que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Una o varias sobrecargas del método que tienen un parámetro de colección params no matriz que podrían ser aplicables solo en forma expandida, lo que no se admite durante el envío dinámico. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Usar el resultado de "{0}" en este contexto puede exponer variables a las que el parámetro "{1}" hace referencia fuera de su ámbito de declaración diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf index f1e5c79255a63..f51de573ca84e 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf @@ -2872,36 +2872,6 @@ Référence de l’analyseur spécifiée plusieurs fois - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges de constructeur ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges de constructeur ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges d’indexeur ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges d’indexeur ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges de méthode « {0} » ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Il est possible qu’une ou plusieurs surcharges de méthode ayant un paramètre de collection de params non-tableau soient applicables uniquement sous une forme développée, ce qui n’est pas pris en charge lors d’une répartition dynamique. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Utiliser un résultat de '{0}' dans ce contexte peut exposer les variables référencées par le paramètre '{1}' en dehors de la portée de leur déclaration diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf index 0d1fdf5d662f7..65613b4fbd281 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf @@ -2872,36 +2872,6 @@ Riferimento analizzatore specificato più volte - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload del costruttore con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload del costruttore con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload dell'indicizzatore con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload dell'indicizzatore con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload del metodo '{0}' con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uno o più overload del metodo con parametro di raccolta dei parametri non di matrice possono essere applicati solo in formato espanso che non è supportato durante l'invio dinamico. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope L'uso del risultato di '{0}' in questo contesto può esporre variabili a cui fa riferimento il parametro '{1}' all'esterno del relativo ambito di dichiarazione diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf index df8a7a358820c..1fe44a2bc159f 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf @@ -2872,36 +2872,6 @@ 複数回指定されたアナライザー参照 - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列 params 以外のコレクション パラメーターを持つ 1 つ以上のコンストラクター オーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列 params 以外のコレクション パラメーターを持つ 1 つ以上のコンストラクター オーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列パラメーター以外のコレクション パラメーターを持つ 1 つ以上のインデクサー オーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列パラメーター以外のコレクション パラメーターを持つ 1 つ以上のインデクサー オーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列 params 以外のコレクション パラメーターを持つメソッド '{0}' の 1 つ以上のオーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 配列パラメーター以外のコレクション パラメーターを持つメソッドの 1 つ以上のオーバーロードは、動的ディスパッチ中にサポートされない拡張形式でのみ適用できます。 - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope このコンテキストで '{0}' の結果を使用すると、パラメーター '{1}' によって参照される変数が宣言のスコープ外に公開される可能性があります diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf index f1573965ae9e7..e6a84fba71344 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf @@ -2872,36 +2872,6 @@ 여러 번 지정된 분석기 참조 - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 하나 이상의 생성자 오버로드는 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 하나 이상의 생성자 오버로드는 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 하나 이상의 인덱서 오버로드는 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 하나 이상의 인덱서 오버로드는 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 '{0}' 메서드의 하나 이상의 오버로드는 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 배열 매개 변수가 아닌 params 컬렉션 매개 변수가 있는 메서드의 오버로드 하나 이상은 동적 디스패치 중에 지원되지 않는 확장된 형식에서만 적용할 수 있습니다. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope 이 컨텍스트에서 '{0}' 결과를 사용하면 선언 범위 외부에서 '{1}' 매개 변수가 참조하는 변수가 노출될 수 있습니다. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf index cd2a96d55a912..2c222144ccdea 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf @@ -2872,36 +2872,6 @@ Odwołanie do analizatora określono wiele razy - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno lub więcej przeciążeń konstruktora z parametrem kolekcji parametrów niebędącym tablicą może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno lub więcej przeciążeń konstruktora z parametrem kolekcji parametrów niebędącym tablicą może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno lub więcej przeciążeń indeksatora z parametrem kolekcji niebędącym tablicą parametrów może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Jedno lub więcej przeciążeń indeksatora z parametrem kolekcji niebędącym tablicą parametrów może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Co najmniej jedno przeciążenie metody „{0}” z parametrem kolekcji params innych niż tablicowe może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Co najmniej jedno przeciążenie metody posiadającej parametr kolekcji params inny niż tablica może mieć zastosowanie tylko w rozszerzonej formie, która nie jest obsługiwana podczas dynamicznego wysyłania. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Użycie wyniku „{0}” w tym kontekście może uwidocznić zmienne przywoływane przez parametr „{1}” poza zakresem deklaracji diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf index 611cf42e4ab3a..2dfcafb5266f7 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf @@ -2872,36 +2872,6 @@ Referência do analisador especificada várias vezes - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uma ou mais sobrecargas de construtor com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis somente na forma expandida, o que não tem suporte durante o envio dinâmico. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uma ou mais sobrecargas de construtor com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis somente na forma expandida, o que não tem suporte durante o envio dinâmico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uma ou mais sobrecargas de indexador com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis somente na forma expandida, o que não tem suporte durante o envio dinâmico. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uma ou mais sobrecargas de indexador com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis somente na forma expandida, o que não tem suporte durante o envio dinâmico. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Um ou mais métodos sobrecarregados '{0}' com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis apenas em forma expandida, o que não é suportado durante o despacho dinâmico. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Uma ou mais sobrecargas de método com parâmetro de coleção de params que não é uma matriz podem ser aplicáveis apenas na forma expandida, o que não tem suporte durante a expedição dinâmica. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope O uso do resultado de '{0}' nesse contexto pode expor variáveis referenciadas por parâmetro '{1}' fora de seu escopo de declaração diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf index 7d06210be0a69..3930417dae824 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf @@ -2872,36 +2872,6 @@ Ссылка на анализатор указана несколько раз - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок конструктора, содержащих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, не поддерживаемой во время динамической отправки. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок конструктора, содержащих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, не поддерживаемой во время динамической отправки. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок индексатора, содержащих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, не поддерживаемой во время динамической отправки. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок индексатора, содержащих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, не поддерживаемой во время динамической отправки. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок метода "{0}", имеющих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, которая не поддерживается во время динамической отправки. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Одна или несколько перегрузок метода, имеющих параметр коллекции params, отличный от массива, могут быть применимы только в расширенной форме, которая не поддерживается во время динамической отправки. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Использование результата "{0}" в этом контексте может представить переменные, на которые ссылается параметр "{1}", за пределами области их объявления diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf index 7b8ebf4d1c063..ad744f2e1a9e8 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf @@ -2872,36 +2872,6 @@ Çözümleyici referansı birden çok kez belirtildi - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip bir veya daha fazla oluşturucu aşırı yükleme yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip bir veya daha fazla oluşturucu aşırı yükleme yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip bir veya daha fazla dizin oluşturucu aşırı yükleme yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip bir veya daha fazla dizin oluşturucu aşırı yükleme yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip '{0}' metodunun bir veya daha fazla aşırı yüklemesi yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - Dizi olmayan parametreler koleksiyonu parametresine sahip metodun bir veya daha fazla aşırı yüklemesi yalnızca genişletilmiş formda uygulanıyor olabilir. Bu, dinamik dağıtım sırasında desteklenmez. - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope Bu bağlamda '{0}' sonucunun kullanılması, '{1}' parametresi tarafından başvurulan değişkenleri bildirim kapsamının dışında gösterebilir. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf index 51aa9ecc8e9e2..2d9f977417bf7 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf @@ -2872,36 +2872,6 @@ 已多次指定分析器引用 - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的一个或多个构造函数重载可能仅适用于在动态调度期间不受支持的展开格式。 - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的一个或多个构造函数重载可能仅适用于在动态调度期间不受支持的展开格式。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的一个或多个索引器重载可能仅适用于在动态调度期间不受支持的展开格式。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的一个或多个索引器重载可能仅适用于在动态调度期间不受支持的展开格式。 - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的“{0}”方法的一个或多个方法重载可能仅适用于在动态调度期间不受支持的展开格式。 - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 具有非数组 params 集合参数的方法的一个或多个重载可能仅适用于在动态调度期间不受支持的扩展形式。 - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope 在此上下文中使用“{0}”的结果可能会在变量声明范围以外公开由参数“{1}”引用的变量 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf index bc018865e1525..bcbc5420069e3 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf @@ -2872,36 +2872,6 @@ 已指定多次分析器參考 - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的建構函式多載可能只適用於展開形式,但其在動態分派期間不支援。 - - - - One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的建構函式多載可能只適用於展開形式,但其在動態分派期間不支援。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的索引子多載可能只適用於展開形式,但其在動態分派期間不支援。 - - - - One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的索引子多載可能只適用於展開形式,但其在動態分派期間不支援。 - - - - One or more overloads of method '{0}' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的方法 '{0}' 多載可能只適用於展開形式,但其在動態分派期間不支援。 - - - - One or more overloads of method having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - 一或多個具有非陣列參數集合參數的方法多載可能只適用於展開形式,但其在動態分派期間不支援。 - - Use of result of '{0}' in this context may expose variables referenced by parameter '{1}' outside of their declaration scope 在此內容中使用 '{0}' 的結果,可能會將參數 '{1}' 參考的變數公開在其宣告範圍外 diff --git a/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs b/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs index e8aa55df720ae..f97332870ee6f 100644 --- a/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs +++ b/src/Compilers/CSharp/Test/Emit2/Semantics/ParamsCollectionTests.cs @@ -6225,30 +6225,9 @@ static void Main() var comp = CreateCompilation(src2, references: [comp1Ref], targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); var expected = new[] { - // (8,9): warning CS9220: One or more overloads of method 'Test1' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test1(d1); // Called2 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test1(d1)").WithArguments("Test1").WithLocation(8, 9), - // (11,9): warning CS9220: One or more overloads of method 'Test1' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test1(d2); // Called1 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test1(d2)").WithArguments("Test1").WithLocation(11, 9), - // (12,9): warning CS9220: One or more overloads of method 'Test2' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test2(1, d1); // Called3 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test2(1, d1)").WithArguments("Test2").WithLocation(12, 9), - // (13,9): warning CS9220: One or more overloads of method 'Test2' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test2(1, d2); // Called5 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test2(1, d2)").WithArguments("Test2").WithLocation(13, 9), - // (20,9): warning CS9220: One or more overloads of method 'Test3' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test3(d3, 1, 2); // Called7 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test3(d3, 1, 2)").WithArguments("Test3").WithLocation(20, 9), // (21,9): error CS9218: 'Helpers.Test3(byte, params IEnumerable)' is applicable only with expanded form of non-array params collection which is not supported during dynamic dispatch. // Test3(d3, x, x); // Called6 - Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "Test3(d3, x, x)").WithArguments("Helpers.Test3(byte, params System.Collections.Generic.IEnumerable)").WithLocation(21, 9), - // (25,9): warning CS9220: One or more overloads of method 'Test4' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test4(d3, x, x); // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test4(d3, x, x)").WithArguments("Test4").WithLocation(25, 9), - // (26,9): warning CS9220: One or more overloads of method 'Test4' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test4(d3, d4, d4); // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test4(d3, d4, d4)").WithArguments("Test4").WithLocation(26, 9) + Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "Test3(d3, x, x)").WithArguments("Helpers.Test3(byte, params System.Collections.Generic.IEnumerable)").WithLocation(21, 9) }; comp.VerifyDiagnostics(expected); @@ -6799,11 +6778,7 @@ public void Test(int b1, int b2, int b3) """; var comp = CreateCompilation(src, targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); - comp.VerifyDiagnostics( - // (8,9): warning CS9220: One or more overloads of method 'Test' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new C1().Test(1, d, 2); - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "new C1().Test(1, d, 2)").WithArguments("Test").WithLocation(8, 9) - ); + comp.VerifyEmitDiagnostics(); } [Fact] @@ -6837,11 +6812,7 @@ static void Main() CompileAndVerify( comp, expectedOutput: @"Called1Failed"). - VerifyDiagnostics( - // (11,13): warning CS9220: One or more overloads of method 'Test1' having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // Test1(d1); - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod, "Test1(d1)").WithArguments("Test1").WithLocation(11, 13) - ); + VerifyDiagnostics(); } [Fact] @@ -7317,30 +7288,9 @@ static void Main() var comp = CreateCompilation(src2, references: [comp1Ref], targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); var expected = new[] { - // (6,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test1()[d1]; // Called2 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test1()[d1]").WithLocation(6, 13), - // (9,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test1()[d2]; // Called1 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test1()[d2]").WithLocation(9, 13), - // (10,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test2()[1, d1]; // Called3 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test2()[1, d1]").WithLocation(10, 13), - // (11,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test2()[1, d2]; // Called5 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test2()[1, d2]").WithLocation(11, 13), - // (18,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test3()[d3, 1, 2]; // Called7 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test3()[d3, 1, 2]").WithLocation(18, 13), // (19,13): error CS9218: 'Test3.this[byte, params IEnumerable]' is applicable only with expanded form of non-array params collection which is not supported during dynamic dispatch. // _ = new Test3()[d3, x, x]; // Called6 - Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "new Test3()[d3, x, x]").WithArguments("Test3.this[byte, params System.Collections.Generic.IEnumerable]").WithLocation(19, 13), - // (23,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test4()[d3, x, x]; // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test4()[d3, x, x]").WithLocation(23, 13), - // (24,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new Test4()[d3, d4, d4]; // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new Test4()[d3, d4, d4]").WithLocation(24, 13) + Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "new Test3()[d3, x, x]").WithArguments("Test3.this[byte, params System.Collections.Generic.IEnumerable]").WithLocation(19, 13) }; comp.VerifyDiagnostics(expected); @@ -7762,11 +7712,7 @@ class C1 """; var comp = CreateCompilation(src, targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); - comp.VerifyDiagnostics( - // (8,13): warning CS9221: One or more indexer overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // _ = new C1()[1, d, 2]; - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer, "new C1()[1, d, 2]").WithLocation(8, 13) - ); + comp.VerifyEmitDiagnostics(); } [Fact] @@ -7954,30 +7900,9 @@ static void Main() var comp = CreateCompilation(src2, references: [comp1Ref], targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); var expected = new[] { - // (6,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test1(d1); // Called2 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test1(d1)").WithLocation(6, 9), - // (9,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test1(d2); // Called1 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test1(d2)").WithLocation(9, 9), - // (10,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test2(1, d1); // Called3 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test2(1, d1)").WithLocation(10, 9), - // (11,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test2(1, d2); // Called5 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test2(1, d2)").WithLocation(11, 9), - // (18,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test3(d3, 1, 2); // Called7 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test3(d3, 1, 2)").WithLocation(18, 9), // (19,9): error CS9218: 'Test3.Test3(byte, params IEnumerable)' is applicable only with expanded form of non-array params collection which is not supported during dynamic dispatch. // new Test3(d3, x, x); // Called6 - Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "new Test3(d3, x, x)").WithArguments("Test3.Test3(byte, params System.Collections.Generic.IEnumerable)").WithLocation(19, 9), - // (23,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test4(d3, x, x); // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test4(d3, x, x)").WithLocation(23, 9), - // (24,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test4(d3, d4, d4); // Called9 - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test4(d3, d4, d4)").WithLocation(24, 9) + Diagnostic(ErrorCode.ERR_DynamicDispatchToParamsCollection, "new Test3(d3, x, x)").WithArguments("Test3.Test3(byte, params System.Collections.Generic.IEnumerable)").WithLocation(19, 9) }; comp.VerifyDiagnostics(expected); @@ -8127,11 +8052,7 @@ public Test(int b1, int b2, int b3) """; var comp = CreateCompilation(src, targetFramework: TargetFramework.StandardAndCSharp, options: TestOptions.ReleaseExe); - comp.VerifyDiagnostics( - // (8,9): warning CS9222: One or more constructor overloads having non-array params collection parameter might be applicable only in expanded form which is not supported during dynamic dispatch. - // new Test(1, d, 2); - Diagnostic(ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor, "new Test(1, d, 2)").WithLocation(8, 9) - ); + comp.VerifyEmitDiagnostics(); } [Fact] diff --git a/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs b/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs index 6c2c95cb54c3b..2aa8fdc21c6f1 100644 --- a/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs +++ b/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs @@ -431,9 +431,6 @@ public void WarningLevel_2() case ErrorCode.WRN_UseDefViolationRefField: case ErrorCode.WRN_CollectionExpressionRefStructMayAllocate: case ErrorCode.WRN_CollectionExpressionRefStructSpreadMayAllocate: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionMethod: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionIndexer: - case ErrorCode.WRN_DynamicDispatchToParamsCollectionConstructor: case ErrorCode.INF_TooManyBoundLambdas: case ErrorCode.INF_IdentifierConflictWithContextualKeyword: Assert.Equal(1, ErrorFacts.GetWarningLevel(errorCode)); diff --git a/src/Features/Core/Portable/EditAndContinue/EditSession.cs b/src/Features/Core/Portable/EditAndContinue/EditSession.cs index 360db5ce3ea82..985a173377a30 100644 --- a/src/Features/Core/Portable/EditAndContinue/EditSession.cs +++ b/src/Features/Core/Portable/EditAndContinue/EditSession.cs @@ -566,7 +566,7 @@ private static ProjectAnalysisSummary GetProjectAnalysisSummary(ImmutableArray EmitSolutionUpdateAsync(Solution solution { if (newProject.FilePath == null) { - log.Write("Skipping project '{0}' without a file path", newProject.Id); + log.Write("Skipping project '{0}' without a file path", newProject.Name); continue; } var oldProject = oldSolution.GetProject(newProject.Id); if (oldProject == null) { - log.Write("EnC state of '{0}' queried: project not loaded", newProject.Id); + log.Write("EnC state of {0} '{1}' queried: project not loaded", newProject.Name, newProject.FilePath); // TODO (https://github.com/dotnet/roslyn/issues/1204): // @@ -836,7 +836,7 @@ public async ValueTask EmitSolutionUpdateAsync(Solution solution continue; } - log.Write("Found {0} potentially changed document(s) in project '{1}'", changedOrAddedDocuments.Count, newProject.Id); + log.Write("Found {0} potentially changed document(s) in project {1} '{2}'", changedOrAddedDocuments.Count, newProject.Name, newProject.FilePath); var (mvid, mvidReadError) = await DebuggingSession.GetProjectModuleIdAsync(newProject, cancellationToken).ConfigureAwait(false); if (mvidReadError != null) @@ -853,7 +853,7 @@ public async ValueTask EmitSolutionUpdateAsync(Solution solution if (mvid == Guid.Empty) { - log.Write("Emitting update of '{0}': project not built", newProject.Id); + log.Write("Emitting update of {0} '{1}': project not built", newProject.Name, newProject.FilePath); continue; } @@ -884,7 +884,14 @@ public async ValueTask EmitSolutionUpdateAsync(Solution solution foreach (var changedDocumentAnalysis in changedDocumentAnalyses) { - if (changedDocumentAnalysis.HasChanges) + if (changedDocumentAnalysis.SyntaxError != null) + { + // only remember the first syntax error we encounter: + syntaxError ??= changedDocumentAnalysis.SyntaxError; + + log.Write("Changed document '{0}' has syntax error: {1}", changedDocumentAnalysis.FilePath, changedDocumentAnalysis.SyntaxError); + } + else if (changedDocumentAnalysis.HasChanges) { log.Write("Document changed, added, or deleted: '{0}'", changedDocumentAnalysis.FilePath); } @@ -893,7 +900,7 @@ public async ValueTask EmitSolutionUpdateAsync(Solution solution } var projectSummary = GetProjectAnalysisSummary(changedDocumentAnalyses); - log.Write("Project summary for '{0}': {1}", newProject.Id, projectSummary); + log.Write("Project summary for {0} '{1}': {2}", newProject.Name, newProject.FilePath, projectSummary); if (projectSummary == ProjectAnalysisSummary.NoChanges) { @@ -912,13 +919,7 @@ public async ValueTask EmitSolutionUpdateAsync(Solution solution isBlocked = true; } - if (projectSummary == ProjectAnalysisSummary.CompilationErrors) - { - // only remember the first syntax error we encounter: - syntaxError ??= changedDocumentAnalyses.FirstOrDefault(a => a.SyntaxError != null)?.SyntaxError; - isBlocked = true; - } - else if (projectSummary == ProjectAnalysisSummary.RudeEdits) + if (projectSummary is ProjectAnalysisSummary.SyntaxErrors or ProjectAnalysisSummary.RudeEdits) { isBlocked = true; } @@ -977,7 +978,7 @@ async ValueTask LogDocumentChangesAsync(int? generation, CancellationToken cance } } - log.Write("Emitting update of '{0}'", newProject.Id); + log.Write("Emitting update of '{0}' {1}", newProject.Name, newProject.FilePath); var newCompilation = await newProject.GetCompilationAsync(cancellationToken).ConfigureAwait(false); Contract.ThrowIfNull(newCompilation); diff --git a/src/Features/Core/Portable/EditAndContinue/EditSessionTelemetry.cs b/src/Features/Core/Portable/EditAndContinue/EditSessionTelemetry.cs index 56e5ad9da9187..73bc0540e4be0 100644 --- a/src/Features/Core/Portable/EditAndContinue/EditSessionTelemetry.cs +++ b/src/Features/Core/Portable/EditAndContinue/EditSessionTelemetry.cs @@ -92,7 +92,7 @@ public void LogProjectAnalysisSummary(ProjectAnalysisSummary summary, Guid proje case ProjectAnalysisSummary.NoChanges: break; - case ProjectAnalysisSummary.CompilationErrors: + case ProjectAnalysisSummary.SyntaxErrors: _hadCompilationErrors = true; break; diff --git a/src/Features/Core/Portable/EditAndContinue/ProjectAnalysisSummary.cs b/src/Features/Core/Portable/EditAndContinue/ProjectAnalysisSummary.cs index 57b194c1e1de2..8f03cc087b81d 100644 --- a/src/Features/Core/Portable/EditAndContinue/ProjectAnalysisSummary.cs +++ b/src/Features/Core/Portable/EditAndContinue/ProjectAnalysisSummary.cs @@ -12,9 +12,9 @@ internal enum ProjectAnalysisSummary NoChanges, /// - /// Project contains compilation errors that block EnC analysis. + /// Project contains syntax errors that block EnC analysis. /// - CompilationErrors, + SyntaxErrors, /// /// Project contains rude edits.