<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">Výraz switch nezachycuje všechny možné hodnoty vstupního typu (není úplný). Nezachycuje například vzor {0}.</target>
...
...
@@ -8289,11 +8299,6 @@ Potlačení upozornění zvažte jenom v případě, když určitě nechcete če
<target state="translated">Vstupním bodem programu je globální kód. Vstupní bod se ignoruje</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Druhý operand operátoru is nebo as nesmí být statického typu {0}.</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Nekonzistentní dostupnost: Typ události {1} je míň dostupný než událost {0}.</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">Der switch-Ausdruck verarbeitet nicht alle möglichen Werte des zugehörigen Eingabetyps (nicht umfassender Ausdruck). Das Muster "{0}" wird beispielsweise nicht abgedeckt.</target>
...
...
@@ -8289,11 +8299,6 @@ Sie sollten das Unterdrücken der Warnung nur in Betracht ziehen, wenn Sie siche
<target state="translated">Der Einstiegspunkt des Programms ist globaler Code. Der Einstiegspunkt wird ignoriert.</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Der zweite Operand eines is- oder as-Operators darf nicht den statischen Typ "{0}" aufweisen.</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Inkonsistenter Zugriff: Ereignistyp "{1}" ist weniger zugreifbar als Ereignis "{0}".</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">La expresión switch no controla todos los valores posibles de su tipo de entrada (no es exhaustivo). Por ejemplo, el patrón "{0}" no está incluido.</target>
...
...
@@ -8289,11 +8299,6 @@ Considere la posibilidad de suprimir la advertencia solo si tiene la seguridad d
<target state="translated">El punto de entrada del programa es código global; se ignora el punto de entrada.</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">El segundo operando de un operador 'is' o 'as' no puede ser el tipo estático '{0}'</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Incoherencia de accesibilidad: el tipo de evento '{1}' es menos accesible que el evento '{0}'</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">L'expression switch ne prend pas en charge toutes les valeurs possibles de son type d'entrée (elle n'est pas exhaustive). Par exemple, le modèle '{0}' n'est pas couvert.</target>
...
...
@@ -8289,11 +8299,6 @@ Supprimez l'avertissement seulement si vous êtes sûr de ne pas vouloir attendr
<target state="translated">Le point d'entrée du programme est du code global ; ce point d'entrée est ignoré</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Le second opérande d'un opérateur 'is' ou 'as' ne peut pas être du type static '{0}'</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Accessibilité incohérente : le type d'événement '{1}' est moins accessible que l'événement '{0}'</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">L'espressione switch non gestisce tutti i possibili valori del relativo tipo di input (non è esaustiva). Ad esempio, il criterio '{0}' non è coperto.</target>
...
...
@@ -8289,11 +8299,6 @@ Come procedura consigliata, è consigliabile attendere sempre la chiamata.
<target state="translated">Il punto di ingresso del programma è codice globale. Il punto di ingresso verrà ignorato</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Il secondo operando di un operatore 'is' o 'as' non può essere di tipo statico '{0}'</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Accessibilità incoerente: il tipo di evento '{1}' è meno accessibile di '{0}'</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">switch 식에서 입력 형식의 가능한 값을 모두 처리하지는 않습니다(전체 아님). 예를 들어 '{0}' 패턴은 포함되지 않습니다.</target>
...
...
@@ -8289,11 +8299,6 @@ You should consider suppressing the warning only if you're sure that you don't w
<target state="translated">프로그램의 진입점이 전역 코드이며 진입점을 무시함</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">is' 또는 'as' 연산자의 두 번째 피연산자는 '{0}' 정적 형식일 수 없습니다.</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">일관성 없는 액세스 가능성: '{1}' 이벤트 형식이 '{0}' 이벤트보다 액세스하기 어렵습니다.</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">Wyrażenie switch nie obsługuje wszystkich możliwych wartości typu wejściowego (nie jest wyczerpujące). Na przykład nie jest uwzględniony wzorzec „{0}”.</target>
...
...
@@ -8289,11 +8299,6 @@ Pominięcie ostrzeżenia należy wziąć pod uwagę tylko w sytuacji, gdy na pew
<target state="translated">Punkt wejścia programu to kod globalny; punkt wejścia jest ignorowany</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Drugi operand operatora „is” lub „as” nie może być typem statycznym „{0}”</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Niespójność dostępności: typ zdarzenia „{1}” jest mniej dostępny niż zdarzenie „{0}”</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">A expressão switch não manipula todos os valores possíveis do tipo de entrada (ela não é exaustiva). Por exemplo, o padrão '{0}' não é coberto.</target>
...
...
@@ -8288,11 +8298,6 @@ Você pode suprimir o aviso se tiver certeza de que não vai querer aguardar a c
<target state="translated">O ponto de entrada do programa é o código global. Ignorando o ponto de entrada</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">O segundo operando de um operador "is" ou "as" não pode ser do tipo estático "{0}"</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Acessibilidade inconsistente: tipo de evento "{1}" é menos acessível do que o evento "{0}"</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">Выражение switch не обрабатывает все возможные типы входных значений (не является исчерпывающим). Например, шаблон "{0}" не охвачен.</target>
...
...
@@ -8289,11 +8299,6 @@ You should consider suppressing the warning only if you're sure that you don't w
<target state="translated">Точкой входа программы является глобальный код; игнорируется точка входа</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Второй операнд оператора "is" или "as" не может быть статического типа "{0}".</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Несогласованность по доступности: доступность типа события "{1}" ниже доступности события "{0}"</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<target state="translated">Switch ifadesi kendi giriş türünün tüm olası değerlerini işlemiyor (tam kapsamlı değil). Örneğin, '{0}' deseni kapsanmıyor.</target>
...
...
@@ -8289,11 +8299,6 @@ Yalnızca asenkron çağrının tamamlanmasını beklemek istemediğinizden ve
<target state="translated">Programın giriş noktası genel koddur, giriş noktası yoksayılıyor</target>
<note />
</trans-unit>
<trans-unit id="ERR_StaticInAsOrIs">
<source>The second operand of an 'is' or 'as' operator may not be static type '{0}'</source>
<target state="translated">Bir 'is' veya 'as' işlecinin ikinci işleneni '{0}' statik türü olmayabilir</target>
<note />
</trans-unit>
<trans-unit id="ERR_BadVisEventType">
<source>Inconsistent accessibility: event type '{1}' is less accessible than event '{0}'</source>
<target state="translated">Tutarsız erişilebilirlik: '{1}' olay türü, '{0}' olayından daha az erişilebilir</target>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
<source>The switch expression does not handle all possible values of its input type (it is not exhaustive). For example, the pattern '{0}' is not covered.</source>
// BREAKING CHANGE: The C# specification states that it is always illegal
// BREAKING CHANGE: to use a static type with "is" and "as". The native
// BREAKING CHANGE: compiler allows it in some cases; Roslyn does not.
// The C# specification states that it is always illegal
// to use a static type with "is" and "as". The native
// compiler allows it in some cases; Roslyn gives a warning
// at level '/warn:5' or higher.
var text = @"
static class C
...
...
@@ -12910,55 +12911,63 @@ static void M(object o)
}
}
";
var regularComp = CreateCompilation(text);
// these diagnostics correspond to those produced by the native compiler.
regularComp.VerifyDiagnostics(
var strictDiagnostics = new[]
{
// (6,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(o as C); // legal in native
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "o as C").WithArguments("C").WithLocation(6, 11),
// (7,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(new object() as C); // legal in native
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "new object() as C").WithArguments("C").WithLocation(7, 11),
// (8,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(null as C); // legal in native
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "null as C").WithArguments("C").WithLocation(8, 11),
// (9,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(1 as C);
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "1 as C").WithArguments("C").WithLocation(9, 11),
// (9,11): error CS0039: Cannot convert type 'int' to 'C' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion
// M(1 as C);
Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, "1 as C").WithArguments("int", "C").WithLocation(9, 11),
// (10,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M("a" as C);
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, @"""a"" as C").WithArguments("C").WithLocation(10, 11),
// (10,11): error CS0039: Cannot convert type 'string' to 'C' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion
// M("a" as C);
Diagnostic(ErrorCode.ERR_NoExplicitBuiltinConv, @"""a"" as C").WithArguments("string", "C").WithLocation(10, 11),
// (12,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(o is C); // legal in native, no warning
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "o is C").WithArguments("C").WithLocation(12, 11),
// (13,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(new object() is C); // legal in native, no warning
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "new object() is C").WithArguments("C").WithLocation(13, 11),
// (14,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(null is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "null is C").WithArguments("C").WithLocation(14, 11),
// (14,11): warning CS0184: The given expression is never of the provided ('C') type
// M(null is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "null is C").WithArguments("C").WithLocation(14, 11),
// (15,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M(1 is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, "1 is C").WithArguments("C").WithLocation(15, 11),
// (15,11): warning CS0184: The given expression is never of the provided ('C') type
// M(1 is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_IsAlwaysFalse, "1 is C").WithArguments("C").WithLocation(15, 11),
// (16,11): warning CS7023: The second operand of an 'is' or 'as' operator may not be static type 'C'
// M("a" is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_StaticInAsOrIs, @"""a"" is C").WithArguments("C").WithLocation(16, 11),
// (16,11): warning CS0184: The given expression is never of the provided ('C') type
// M("a" is C); // legal in native, warns
Diagnostic(ErrorCode.WRN_IsAlwaysFalse, @"""a"" is C").WithArguments("C").WithLocation(16, 11)
);
// in strict mode we also diagnose "is" and "as" operators with a static type.
var strictComp = CreateCompilation(text, parseOptions: TestOptions.Regular.WithStrictFeature());
strictComp.VerifyDiagnostics(
// In the native compiler these three produce no errors.
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "o as C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "new object() as C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "null as C").WithArguments("C"),
// In the native compiler these two produce:
// error CS0039: Cannot convert type 'int' to 'C' via a reference conversion, boxing conversion,
// unboxing conversion, wrapping conversion, or null type conversion
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "1 as C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "\"a\" as C").WithArguments("C"),
// In the native compiler these two produce no errors:
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "o is C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "new object() is C").WithArguments("C"),
};
// In the native compiler these three produce:
// warning CS0184: The given expression is never of the provided ('C') type
// in /warn:5 we diagnose "is" and "as" operators with a static type.
var strictComp = CreateCompilation(text, options: TestOptions.ReleaseDll.WithWarningLevel(5));
strictComp.VerifyDiagnostics(strictDiagnostics);
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "null is C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "1 is C").WithArguments("C"),
Diagnostic(ErrorCode.ERR_StaticInAsOrIs, "\"a\" is C").WithArguments("C")
);
// these rest of the diagnostics correspond to those produced by the native compiler.
var regularDiagnostics = strictDiagnostics.Where(d => !d.Code.Equals((int)ErrorCode.WRN_StaticInAsOrIs)).ToArray();