From 7c901b800bf1bb438829d68358985927cfdc03a4 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 7 Jul 2021 10:46:01 -0700 Subject: [PATCH 1/2] Remove a few unused error codes --- .../CSharp/Portable/CSharpResources.resx | 6 ----- .../CSharp/Portable/Errors/ErrorCode.cs | 4 ++-- .../Portable/xlf/CSharpResources.cs.xlf | 10 -------- .../Portable/xlf/CSharpResources.de.xlf | 10 -------- .../Portable/xlf/CSharpResources.es.xlf | 10 -------- .../Portable/xlf/CSharpResources.fr.xlf | 10 -------- .../Portable/xlf/CSharpResources.it.xlf | 10 -------- .../Portable/xlf/CSharpResources.ja.xlf | 10 -------- .../Portable/xlf/CSharpResources.ko.xlf | 10 -------- .../Portable/xlf/CSharpResources.pl.xlf | 10 -------- .../Portable/xlf/CSharpResources.pt-BR.xlf | 10 -------- .../Portable/xlf/CSharpResources.ru.xlf | 10 -------- .../Portable/xlf/CSharpResources.tr.xlf | 10 -------- .../Portable/xlf/CSharpResources.zh-Hans.xlf | 10 -------- .../Portable/xlf/CSharpResources.zh-Hant.xlf | 10 -------- .../Semantic/Semantics/LocalFunctionTests.cs | 23 +++++++++---------- 16 files changed, 13 insertions(+), 150 deletions(-) diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx index 00140848865b4..4d3d064b4dd9b 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.resx +++ b/src/Compilers/CSharp/Portable/CSharpResources.resx @@ -4175,9 +4175,6 @@ You should consider suppressing the warning only if you're sure that you don't w The best overloaded Add method '{0}' for the collection initializer element is obsolete. {1} - - Yield statements may not appear at the top level in interactive code. - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. @@ -5320,9 +5317,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ For type '{0}' to be used as an AsyncMethodBuilder for type '{1}', its Task property should return type '{1}' instead of type '{2}'. - - Attributes are not allowed on local function parameters or type parameters - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs index d13a861e65fbe..6dbed30d51752 100644 --- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs +++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs @@ -1207,7 +1207,7 @@ internal enum ErrorCode //WRN_PDBConstantStringValueTooLong = 7063, gave up on this warning ERR_CantOpenIcon = 7064, ERR_ErrorBuildingWin32Resources = 7065, - ERR_IteratorInInteractive = 7066, + // ERR_IteratorInInteractive = 7066, ERR_BadAttributeParamDefaultArgument = 7067, ERR_MissingTypeInSource = 7068, ERR_MissingTypeInAssembly = 7069, @@ -1468,7 +1468,7 @@ internal enum ErrorCode ERR_PublicSignNetModule = 8202, ERR_BadAssemblyName = 8203, ERR_BadAsyncMethodBuilderTaskProperty = 8204, - ERR_AttributesInLocalFuncDecl = 8205, + // ERR_AttributesInLocalFuncDecl = 8205, ERR_TypeForwardedToMultipleAssemblies = 8206, ERR_ExpressionTreeContainsDiscard = 8207, ERR_PatternDynamicType = 8208, diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf index 0570a91630e99..4be6fafdf69c9 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf @@ -9239,11 +9239,6 @@ Potlačení upozornění zvažte jenom v případě, když určitě nechcete če Optimální přetěžovaná metoda Add {0} pro element inicializátoru kolekce je zastaralá. {1} - - Yield statements may not appear at the top level in interactive code. - Příkazy yield se nesmí objevit na horní úrovni v interaktivním kódu. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. Atribut zabezpečení {0} není platný u tohoto typu deklarace. Atributy zabezpečení jsou platné jenom u deklarací sestavení, typu a metody. @@ -10772,11 +10767,6 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference Aby se typ {0} mohl použít jako AsyncMethodBuilder pro typ {1}, měla by jeho vlastnost Task vracet typ {1} místo typu {2}. - - Attributes are not allowed on local function parameters or type parameters - V parametrech místní funkce nebo v parametrech typu se atributy nepovolují. - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Modul {0} v sestavení {1} předává typ {2} několika sestavením: {3} a {4}. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf index 5efe6c0756cda..97f61dcc2e0b8 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf @@ -9239,11 +9239,6 @@ Sie sollten das Unterdrücken der Warnung nur in Betracht ziehen, wenn Sie siche Die beste überladene Add-Methode "{0}" für das Sammlungsinitialisiererelement ist veraltet. {1} - - Yield statements may not appear at the top level in interactive code. - Yield-Anweisungen dürfen nicht in der obersten Ebene von interaktivem Code enthalten sein. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. Das Sicherheitsattribut "{0}" ist für diesen Deklarationstyp nicht gültig. Sicherheitsattribute sind nur für Assembly-, Typ- und Methodendeklarationen gültig. @@ -10772,11 +10767,6 @@ Um die Warnung zu beheben, können Sie stattdessen /reference verwenden (Einbett Damit der Typ "{0}" als "AsyncMethodBuilder" für den Typ "{1}" verwendet wird, muss seine Aufgabeneigenschaft den Typ "{1}" anstelle des Typs "{2}" zurückgeben. - - Attributes are not allowed on local function parameters or type parameters - Attribute sind bei lokalen Funktionsparametern oder Typenparametern nicht zulässig. - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Das Modul "{0}" in der Assembly "{1}" leitet den Typ "{2}" an mehrere Assemblys weiter: "{3}" und "{4}". diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf index 8fcc19dddb568..fd229a2a052a9 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf @@ -9239,11 +9239,6 @@ Considere la posibilidad de suprimir la advertencia solo si tiene la seguridad d El mejor método Add sobrecargado '{0}' para el elemento inicializador de la colección está obsoleto. {1} - - Yield statements may not appear at the top level in interactive code. - Las instrucciones yield pueden no aparecer en el nivel superior del código interactivo. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. El valor '{0}' de SecurityAction no es válido en este tipo de declaración. Los atributos de seguridad solo son válidos en las declaraciones de ensamblado, de tipo y de método. @@ -10772,11 +10767,6 @@ Para eliminar la advertencia puede usar /reference (establezca la propiedad Embe Para que el tipo "{0}" se utilice como AsyncMethodBuilder para el tipo "{1}", su propiedad Task debe devolver el tipo "{1}" en lugar del tipo "{2}". - - Attributes are not allowed on local function parameters or type parameters - No se permiten atributos en los parámetros de tipo o parámetros de funciones locales. - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. El módulo "{0}" del ensamblado "{1}" va a reenviar el tipo "{2}" a varios ensamblados: "{3}" y "{4}". diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf index 110006141209d..14fbc8691d451 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf @@ -9239,11 +9239,6 @@ Supprimez l'avertissement seulement si vous êtes sûr de ne pas vouloir attendr La meilleure méthode Add surchargée '{0}' pour l'élément initialiseur de collection est obsolète. {1} - - Yield statements may not appear at the top level in interactive code. - Les instructions yield ne peuvent pas figurer au niveau supérieur dans le code interactif. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. L'attribut de sécurité '{0}' n'est pas valide dans ce type de déclaration. Les attributs de sécurité ne sont valides que dans les déclarations d'assembly, de type et de méthode. @@ -10772,11 +10767,6 @@ Pour supprimer l'avertissement, vous pouvez utiliser la commande /reference (dé Pour que le type '{0}' soit utilisé comme AsyncMethodBuilder du type '{1}', sa propriété Task doit retourner le type '{1}' à la place du type '{2}'. - - Attributes are not allowed on local function parameters or type parameters - Les attributs ne sont pas autorisés sur les paramètres de fonction locale ou les paramètres de type - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Le module '{0}' dans l'assembly '{1}' transfère le type '{2}' à plusieurs assemblys : '{3}' et '{4}'. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf index 2d8aeadcb0b27..9685b517fecfa 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf @@ -9239,11 +9239,6 @@ Come procedura consigliata, è consigliabile attendere sempre la chiamata. Il miglior metodo Add di overload '{0}' per l'elemento inizializzatore di raccolta è obsoleto. {1} - - Yield statements may not appear at the top level in interactive code. - Le istruzioni yield potrebbero non apparire al primo livello del codice interattivo. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. L'attributo di sicurezza '{0}' non è valido in questo tipo di dichiarazione. Gli attributi di sicurezza sono validi solo in dichiarazioni di metodo, assembly e tipi. @@ -10772,11 +10767,6 @@ Per rimuovere l'avviso, è invece possibile usare /reference (impostare la propr La proprietà Task del tipo '{0}' da usare come elemento AsyncMethodBuilder per il tipo '{1}' deve restituire il tipo '{1}' invece di '{2}'. - - Attributes are not allowed on local function parameters or type parameters - Gli attributi non sono consentiti in parametri di funzione locali o parametri di tipo - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Il modulo '{0}' nell'assembly '{1}' inoltra il tipo '{2}' a più assembly '{3}' e '{4}'. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf index 3c374bd1f9a63..8679a2ea06ef7 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf @@ -9239,11 +9239,6 @@ You should consider suppressing the warning only if you're sure that you don't w コレクション初期化子要素に最も適しているオーバーロード Add メソッド '{0}' は古い形式です。{1} - - Yield statements may not appear at the top level in interactive code. - Yield ステートメントは、対話型コードの最上部に表示できません。 - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. セキュリティ属性 '{0}' はこの宣言型では無効です。セキュリティ属性は、アセンブリ、型、メソッドの宣言でのみ有効です。 @@ -10772,11 +10767,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ 型 '{0}' を型 '{1}' の AsyncMethodBuilder として使うには、その Task プロパティが型 '{2}' ではなく型 '{1}' を返す必要があります。 - - Attributes are not allowed on local function parameters or type parameters - ローカル関数パラメーターまたは型パラメーターに属性を使うことはできません - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. アセンブリ '{1}' のモジュール '{0}' によって、型 '{2}' が複数のアセンブリ '{3}' および '{4}' に転送されています。 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf index d9f1755292662..bde75e8bc6710 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf @@ -9238,11 +9238,6 @@ You should consider suppressing the warning only if you're sure that you don't w 오버로드된 Add 메서드 중 해당 컬렉션 이니셜라이저 요소에 가장 적합한 '{0}'은(는) 사용되지 않습니다. {1} - - Yield statements may not appear at the top level in interactive code. - Yield 문이 대화형 코드의 최상위 수준에 표시되지 않을 수 있습니다. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. 이 선언 형식에서는 '{0}' 보안 특성이 유효하지 않습니다. 보안 특성은 어셈블리, 형식 및 메서드 선언에서만 유효합니다. @@ -10771,11 +10766,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ '{1}' 형식에 대한 AsyncMethodBuilder로 사용할 '{0}' 형식의 작업 속성은 '{2}' 형식 대신 '{1}' 형식을 반환해야 합니다. - - Attributes are not allowed on local function parameters or type parameters - 특성은 로컬 함수 매개 변수 또는 형식 매개 변수에서 사용할 수 없습니다. - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. '{1}' 어셈블리의 '{0}' 모듈이 여러 어셈블리 '{3}' 및 '{4}'에 '{2}' 형식을 전달하고 있습니다. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf index e50dc5ffa7d45..16d41db6b4b75 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf @@ -9239,11 +9239,6 @@ Pominięcie ostrzeżenia należy wziąć pod uwagę tylko w sytuacji, gdy na pew Najlepsza przeciążona metoda Add „{0}” dla elementu inicjatora kolekcji jest przestarzała. {1} - - Yield statements may not appear at the top level in interactive code. - Instrukcje yield nie mogą pojawiać się na najwyższym poziomie kodu interaktywnego. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. Atrybut zabezpieczeń „{0}” jest nieprawidłowy w tym typie deklaracji. Atrybuty zabezpieczeń są prawidłowe tylko dla deklaracji zestawu, typu i metody. @@ -10772,11 +10767,6 @@ Aby usunąć ostrzeżenie, możesz zamiast tego użyć opcji /reference (ustaw w Aby typ „{0}” mógł zostać użyty jako element AsyncMethodBuilder dla typu „{1}”, jego właściwość zadania powinna zwracać typ „{1}” zamiast typu „{2}”. - - Attributes are not allowed on local function parameters or type parameters - Atrybuty nie są dozwolone w przypadku lokalnych parametrów funkcji lub parametrów typu - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Moduł „{0}” w zestawie „{1}” przekazuje typ „{2}” do wielu zestawów: „{3}” i „{4}”. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf index 7733143f14c35..f0c2f0bbae59e 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf @@ -9239,11 +9239,6 @@ Você pode suprimir o aviso se tiver certeza de que não vai querer aguardar a c O melhor método Adicionar sobrecarregado "{0}" para o elemento do inicializador de coleção está obsoleto. {1} - - Yield statements may not appear at the top level in interactive code. - Instruções yield podem não aparecer no nível superior no código interativo. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. Atributo de segurança "{0}" não é válido neste tipo de declaração. Atributos de segurança são somente válidos em declarações de assembly, tipo e método. @@ -10772,11 +10767,6 @@ Para incorporar informações de tipo de interoperabilidade para os dois assembl Para o tipo '{0}' a ser usado como um AsyncMethodBuilder para o tipo '{1}', sua propriedade Task deve retornar o tipo '{1}' em vez do tipo '{2}'. - - Attributes are not allowed on local function parameters or type parameters - Os atributos não são permitidos em parâmetros de função local ou parâmetros de tipo - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. O módulo '{0}' no assembly '{1}' está encaminhando o tipo '{2}' para vários assemblies: '{3}' e '{4}'. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf index 1faec76c91625..3c4efe4421a1a 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf @@ -9239,11 +9239,6 @@ You should consider suppressing the warning only if you're sure that you don't w Наиболее подходящий перегруженный метод Add "{0}" для элемента инициализатора набора устарел. {1} - - Yield statements may not appear at the top level in interactive code. - Операторы yield не могут использоваться на верхнем уровне интерактивного кода. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. Атрибут безопасности "{0}" не допускается для этого типа объявления. Атрибуты безопасности допустимы только в сборке, типе и объявлениях метода. @@ -10772,11 +10767,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ Чтобы тип "{0}" можно было использовать как AsyncMethodBuilder для типа "{1}", его свойство Task должно возвращать тип "{1}" вместо "{2}". - - Attributes are not allowed on local function parameters or type parameters - Атрибуты запрещены для параметров локальной функции и параметров типа - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. Модуль "{0}" в сборке "{1}" перенаправляет тип "{2}" в несколько сборок: "{3}" и "{4}". diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf index df71595d36eea..7fc6515216d2e 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf @@ -9239,11 +9239,6 @@ Yalnızca asenkron çağrının tamamlanmasını beklemek istemediğinizden ve Koleksiyon başlatıcı öğesi için en iyi aşırı yüklenen '{0}' Ekle yöntemi artık kullanılmıyor. {1} - - Yield statements may not appear at the top level in interactive code. - Yield deyimleri etkileşimli kodun en üst düzeyinde görünmeyebilir. - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. '{0}' güvenlik özniteliği bu bildirim türü için geçerli değil. Güvenlik öznitelikleri yalnızca derleme, tür ve yöntem bildirimlerinde geçerlidir. @@ -10772,11 +10767,6 @@ Uyarıyı kaldırmak için, /reference kullanabilirsiniz (Birlikte Çalışma T '{0}' türünün '{1}' türü için AsyncMethodBuilder olarak kullanılması için, Task özelliğinin '{2}' türü yerine '{1}' türü döndürmesi gerekir. - - Attributes are not allowed on local function parameters or type parameters - Yerel işlev parametrelerinde veya tür parametrelerinde özniteliklere izin verilmez - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. '{1}' bütünleştirilmiş kodundaki '{0}' modülü, '{2}' türünü birden çok bütünleştirilmiş koda iletiyor: '{3}' ve '{4}'. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf index bc57dfcd8bcba..5df079ac4d629 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf @@ -9244,11 +9244,6 @@ You should consider suppressing the warning only if you're sure that you don't w 与集合初始值设定项元素最匹配的重载 Add 方法“{0}”已过时。{1} - - Yield statements may not appear at the top level in interactive code. - Yield 语句不能出现在交互代码中的顶层。 - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. 安全特性“{0}”对此声明类型无效。安全特性仅对程序集、类型和方法声明有效。 @@ -10777,11 +10772,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ 对于用作类型“{1}”的 AsyncMethodBuilder 的类型“{0}”,它的任务属性应返回类型“{1}”,而不是类型“{2}”。 - - Attributes are not allowed on local function parameters or type parameters - 属性在本地函数参数或类型参数中不被允许 - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. 程序集“{1}”中的模块“{0}”将类型“{2}”转发到多个程序集: “{3}”和“{4}”。 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf index 98acd471b6610..c47450663c045 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf @@ -9239,11 +9239,6 @@ You should consider suppressing the warning only if you're sure that you don't w 集合初始設定式元素最符合的多載 Add 方法 '{0}' 已經過時。{1} - - Yield statements may not appear at the top level in interactive code. - Yield 陳述式不可出現在互動式程式碼的最上層。 - - Security attribute '{0}' is not valid on this declaration type. Security attributes are only valid on assembly, type and method declarations. 安全屬性 '{0}' 在此宣告類型上無效。安全屬性只有在組件、類型和方法宣告上才有效。 @@ -10772,11 +10767,6 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ 若要讓 '{0}' 類型作為 '{1}' 類型的 AsyncMethodBuilder,其 Task 屬性應傳回 '{1}' 類型,而非 '{2}' 類型。 - - Attributes are not allowed on local function parameters or type parameters - 區域函式參數或型別參數中不允許屬性 - - Module '{0}' in assembly '{1}' is forwarding the type '{2}' to multiple assemblies: '{3}' and '{4}'. 組件 '{1}' 中的模組 '{0}' 正在將類型 '{2}' 轉送給多個組件: '{3}' 及 '{4}'。 diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs index 9daf64427a68e..21bf1701f668b 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs @@ -1674,7 +1674,7 @@ void M() comp.DeclarationDiagnostics.Verify(); } - [Fact(Skip = "https://github.com/dotnet/roslyn/issues/16652")] + [Fact] public void FetchLocalFunctionSymbolThroughLocal() { var tree = SyntaxFactory.ParseSyntaxTree(@" @@ -1692,31 +1692,30 @@ void Local<[A, B, CLSCompliant, D]T>() }"); var comp = CreateCompilation(tree); comp.DeclarationDiagnostics.Verify(); + comp.VerifyDiagnostics( - // (7,20): error CS8204: Attributes are not allowed on local function parameters or type parameters - // void Local<[A, B, CLSCompliant, D]T>() { } - Diagnostic(ErrorCode.ERR_AttributesInLocalFuncDecl, "[A, B, CLSCompliant, D]").WithLocation(7, 20), // (7,21): error CS0246: The type or namespace name 'AAttribute' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A").WithArguments("AAttribute").WithLocation(7, 21), // (7,21): error CS0246: The type or namespace name 'A' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A").WithArguments("A").WithLocation(7, 21), // (7,24): error CS0246: The type or namespace name 'BAttribute' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "B").WithArguments("BAttribute").WithLocation(7, 24), // (7,24): error CS0246: The type or namespace name 'B' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "B").WithArguments("B").WithLocation(7, 24), // (7,41): error CS0246: The type or namespace name 'DAttribute' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "D").WithArguments("DAttribute").WithLocation(7, 41), // (7,41): error CS0246: The type or namespace name 'D' could not be found (are you missing a using directive or an assembly reference?) - // void Local<[A, B, CLSCompliant, D]T>() { } + // void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "D").WithArguments("D").WithLocation(7, 41), // (7,27): error CS7036: There is no argument given that corresponds to the required formal parameter 'isCompliant' of 'CLSCompliantAttribute.CLSCompliantAttribute(bool)' - // void Local<[A, B, CLSCompliant, D]T>() { } - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "CLSCompliant").WithArguments("isCompliant", "System.CLSCompliantAttribute.CLSCompliantAttribute(bool)").WithLocation(7, 27)); + // void Local<[A, B, CLSCompliant, D]T>() + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "CLSCompliant").WithArguments("isCompliant", "System.CLSCompliantAttribute.CLSCompliantAttribute(bool)").WithLocation(7, 27) +); var model = comp.GetSemanticModel(tree); From 605a0799d37093a2bf327f3f29292a49427db6c2 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 7 Jul 2021 12:00:50 -0700 Subject: [PATCH 2/2] Update src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs --- .../CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs index 21bf1701f668b..135624fcdfa2d 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/LocalFunctionTests.cs @@ -1714,8 +1714,7 @@ void Local<[A, B, CLSCompliant, D]T>() Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "D").WithArguments("D").WithLocation(7, 41), // (7,27): error CS7036: There is no argument given that corresponds to the required formal parameter 'isCompliant' of 'CLSCompliantAttribute.CLSCompliantAttribute(bool)' // void Local<[A, B, CLSCompliant, D]T>() - Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "CLSCompliant").WithArguments("isCompliant", "System.CLSCompliantAttribute.CLSCompliantAttribute(bool)").WithLocation(7, 27) -); + Diagnostic(ErrorCode.ERR_NoCorrespondingArgument, "CLSCompliant").WithArguments("isCompliant", "System.CLSCompliantAttribute.CLSCompliantAttribute(bool)").WithLocation(7, 27)); var model = comp.GetSemanticModel(tree);