From 37ea5220faa6884c97357ceec7d0b4dfac0f78f8 Mon Sep 17 00:00:00 2001 From: Rikki Gibson Date: Wed, 7 Jul 2021 14:52:05 -0700 Subject: [PATCH] Remove a few unused error codes (#54663) --- .../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 | 20 +++++++++---------- 16 files changed, 11 insertions(+), 149 deletions(-) diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx index aad6341c6fead..21ad086110937 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.resx +++ b/src/Compilers/CSharp/Portable/CSharpResources.resx @@ -4178,9 +4178,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. @@ -5323,9 +5320,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 cb923d92fecc3..aa91f7bf47f93 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 121c16fad0544..97d2982584e03 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 f908b0d5422d3..c6dee527c59fe 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 57671af18d194..77655cf5447b6 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 1f46e04f010b8..dd6bfd92a2569 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 bf69fd7898c5a..cff2b1bb679e4 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 a23f9ee2c917a..9fdde0387f169 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.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 型 '{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 99d360b1e0ce5..5ef8690bd9651 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf @@ -9243,11 +9243,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}' 보안 특성이 유효하지 않습니다. 보안 특성은 어셈블리, 형식 및 메서드 선언에서만 유효합니다. @@ -10776,11 +10771,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 c3c0063a34bb7..6a45c06671d6b 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 3faf8abe2adc0..788e01841f702 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 77bd88846fcab..6bdf07d03cbc0 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.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 Чтобы тип "{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 73d522069dc73..b9b4927cd0320 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf @@ -9244,11 +9244,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. @@ -10777,11 +10772,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 3c9dcadc88566..12dada313a27c 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf @@ -9249,11 +9249,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}”对此声明类型无效。安全特性仅对程序集、类型和方法声明有效。 @@ -10782,11 +10777,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 e5cd62db25984..8143824a74a43 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.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 若要讓 '{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..135624fcdfa2d 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,30 +1692,28 @@ 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>() { } + // 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);