diff --git a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs index 59bddff89d383..a1da282f5e4da 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs +++ b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs @@ -16108,7 +16108,7 @@ internal static string WRN_SequentialOnPartialClass_Title { } /// - /// Looks up a localized string similar to The switch expression does not handle all possible inputs (it is not exhaustive).. + /// Looks up a localized string similar to The switch expression does not handle all possible values of its input type (it is not exhaustive).. /// internal static string WRN_SwitchExpressionNotExhaustive { get { @@ -16117,7 +16117,7 @@ internal static string WRN_SwitchExpressionNotExhaustive { } /// - /// Looks up a localized string similar to The switch expression does not handle all possible inputs (it is not exhaustive).. + /// Looks up a localized string similar to The switch expression does not handle all possible values of its input type (it is not exhaustive).. /// internal static string WRN_SwitchExpressionNotExhaustive_Title { get { diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx index 49d678f6ccdcb..129d5dc8005f3 100644 --- a/src/Compilers/CSharp/Portable/CSharpResources.resx +++ b/src/Compilers/CSharp/Portable/CSharpResources.resx @@ -5661,10 +5661,10 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ The syntax 'var' for a pattern is not permitted to refer to a type, but '{0}' is in scope here. - The switch expression does not handle all possible inputs (it is not exhaustive). + The switch expression does not handle all possible values of its input type (it is not exhaustive). - The switch expression does not handle all possible inputs (it is not exhaustive). + The switch expression does not handle all possible values of its input type (it is not exhaustive). The name '_' refers to the constant, not the discard pattern. Use 'var _' to discard the value, or '@_' to refer to a constant by that name. diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf index f165fabf724ab..bdecb0cc157c3 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Výraz switch nezpracovává všechny možné vstupy (není vyčerpávající). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Výraz switch nezpracovává všechny možné vstupy (není vyčerpávající). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Výraz switch nezpracovává všechny možné vstupy (není vyčerpávající). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Výraz switch nezpracovává všechny možné vstupy (není vyčerpávající). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf index 852981fc7c5c6..3451f81f1824a 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Der switch-Ausdruck verarbeitet nicht alle möglichen Eingaben (nicht umfassend). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Der switch-Ausdruck verarbeitet nicht alle möglichen Eingaben (nicht umfassend). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Der switch-Ausdruck verarbeitet nicht alle möglichen Eingaben (nicht umfassend). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Der switch-Ausdruck verarbeitet nicht alle möglichen Eingaben (nicht umfassend). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf index b7efafe36004f..d63363c9bc458 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - La expresión switch no controla todas las entradas posibles (no es exhaustiva). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + La expresión switch no controla todas las entradas posibles (no es exhaustiva). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - La expresión switch no controla todas las entradas posibles (no es exhaustiva). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + La expresión switch no controla todas las entradas posibles (no es exhaustiva). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf index 477032a970d4d..2ff5385ceeaa2 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - L'expression switch ne prend pas en charge toutes les entrées possibles (elle n'est pas exhaustive). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + L'expression switch ne prend pas en charge toutes les entrées possibles (elle n'est pas exhaustive). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - L'expression switch ne prend pas en charge toutes les entrées possibles (elle n'est pas exhaustive). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + L'expression switch ne prend pas en charge toutes les entrées possibles (elle n'est pas exhaustive). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf index 408c6793e27bf..572fd9a428ee1 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - L'espressione switch non gestisce tutti gli input possibili (non è esaustiva). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + L'espressione switch non gestisce tutti gli input possibili (non è esaustiva). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - L'espressione switch non gestisce tutti gli input possibili (non è esaustiva). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + L'espressione switch non gestisce tutti gli input possibili (non è esaustiva). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf index e0b8758b175f1..af5ea60aaf23a 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 式がすべての可能な入力を処理しません (すべてを網羅していません)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 式がすべての可能な入力を処理しません (すべてを網羅していません)。 @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 式がすべての可能な入力を処理しません (すべてを網羅していません)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 式がすべての可能な入力を処理しません (すべてを網羅していません)。 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf index 2c2beac145ba2..fa42dac77839b 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 식은 가능한 입력을 모두 처리하지는 않습니다(전체 아님). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 식은 가능한 입력을 모두 처리하지는 않습니다(전체 아님). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 식은 가능한 입력을 모두 처리하지는 않습니다(전체 아님). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 식은 가능한 입력을 모두 처리하지는 않습니다(전체 아님). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf index 098d699b4b9d4..9e8268228da75 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Wyrażenie switch nie obsługuje wszystkich możliwych danych wejściowych (nie jest kompletne). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Wyrażenie switch nie obsługuje wszystkich możliwych danych wejściowych (nie jest kompletne). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Wyrażenie switch nie obsługuje wszystkich możliwych danych wejściowych (nie jest kompletne). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Wyrażenie switch nie obsługuje wszystkich możliwych danych wejściowych (nie jest kompletne). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf index 9f894e3a8cf6a..7e745aff8ba85 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.pt-BR.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - A expressão switch não manipula todas as entradas possíveis (não é finita). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + A expressão switch não manipula todas as entradas possíveis (não é finita). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - A expressão switch não manipula todas as entradas possíveis (não é finita). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + A expressão switch não manipula todas as entradas possíveis (não é finita). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf index ac5ef82032bc4..074c1206cb04f 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.ru.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Выражение switch обрабатывает не все возможные входные данные (оно не полное). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Выражение switch обрабатывает не все возможные входные данные (оно не полное). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Выражение switch обрабатывает не все возможные входные данные (оно не полное). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Выражение switch обрабатывает не все возможные входные данные (оно не полное). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf index 7dba593d59358..be8a1c5aaa446 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.tr.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Switch ifadesi tüm olası girişleri işlemiyor (tam kapsamlı değil). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Switch ifadesi tüm olası girişleri işlemiyor (tam kapsamlı değil). @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Switch ifadesi tüm olası girişleri işlemiyor (tam kapsamlı değil). + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Switch ifadesi tüm olası girişleri işlemiyor (tam kapsamlı değil). diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf index 900ae6464ec90..f6b9e77dd6b9d 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hans.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Switch 表达式不会处理所有可能的输入(它并非详尽无遗)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Switch 表达式不会处理所有可能的输入(它并非详尽无遗)。 @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - Switch 表达式不会处理所有可能的输入(它并非详尽无遗)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + Switch 表达式不会处理所有可能的输入(它并非详尽无遗)。 diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf index 7240ea06c219f..700a7467faff2 100644 --- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf +++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.zh-Hant.xlf @@ -1753,8 +1753,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 運算式未處理所有可能的輸入 (其並不徹底)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 運算式未處理所有可能的輸入 (其並不徹底)。 @@ -1768,8 +1768,8 @@ - The switch expression does not handle all possible inputs (it is not exhaustive). - switch 運算式未處理所有可能的輸入 (其並不徹底)。 + The switch expression does not handle all possible values of its input type (it is not exhaustive). + switch 運算式未處理所有可能的輸入 (其並不徹底)。 diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs index 6c438c5c1c34b..b739c4601867f 100644 --- a/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs +++ b/src/Compilers/CSharp/Test/Emit/CodeGen/PatternTests.cs @@ -3026,7 +3026,7 @@ static class C { "; var compilation = CreateEmptyCompilation(source, options: TestOptions.ReleaseDll); compilation.GetDiagnostics().Verify( - // (9,38): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,38): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // public static bool M(int i) => i switch { 1 => true }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 38) ); @@ -3036,7 +3036,7 @@ static class C { // (9,36): error CS0656: Missing compiler required member 'System.InvalidOperationException..ctor' // public static bool M(int i) => i switch { 1 => true }; Diagnostic(ErrorCode.ERR_MissingPredefinedMember, "i switch { 1 => true }").WithArguments("System.InvalidOperationException", ".ctor").WithLocation(9, 36), - // (9,38): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,38): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // public static bool M(int i) => i switch { 1 => true }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 38) ); diff --git a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchExpression.cs b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchExpression.cs index e055bf7ccf56c..36a990d4861e1 100644 --- a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchExpression.cs +++ b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchExpression.cs @@ -74,7 +74,7 @@ void M(int? x, object y) Arms(0) "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25) }; @@ -110,7 +110,7 @@ void M(int? x, object y) ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { => 5 }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25), // file.cs(7,34): error CS8504: Pattern missing @@ -355,7 +355,7 @@ void M(int? x, object y) ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { NotFound => 5 }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25), // file.cs(7,34): error CS0103: The name 'NotFound' does not exist in the current context @@ -512,7 +512,7 @@ void M(int? x, object y) ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { 1 => 2, _ when false => 5 }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25) }; @@ -589,7 +589,7 @@ void M(int? x, object y) ILiteralOperation (OperationKind.Literal, Type: System.Int32, Constant: 5) (Syntax: '5') "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { _ when NotFound => 5 }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25), // file.cs(7,41): error CS0103: The name 'NotFound' does not exist in the current context @@ -636,7 +636,7 @@ void M(int? x, object y) Local_2: System.Int32 z "; var expectedDiagnostics = new[] { - // file.cs(7,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(7,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // y = /**/x switch { int z when x is int z => 5 }/**/; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 25), // file.cs(7,54): error CS0128: A local variable or function named 'z' is already defined in this scope diff --git a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchOperation.cs b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchOperation.cs index 68195c994b4e2..7c0c349d50288 100644 --- a/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchOperation.cs +++ b/src/Compilers/CSharp/Test/IOperation/IOperation/IOperationTests_ISwitchOperation.cs @@ -3324,7 +3324,7 @@ public static void Main() } "; var expectedDiagnostics = new[] { - // file.cs(6,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // file.cs(6,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // var r = 1 switch { }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(6, 19), // file.cs(6,19): error CS8506: No best type was found for the switch expression. diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests2.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests2.cs index df535d151ccd1..9f6b272544bfc 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests2.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests2.cs @@ -494,7 +494,7 @@ public static void Main() } }"; CreatePatternCompilation(source).VerifyDiagnostics( - // (5,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (5,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // var r = 1 switch { }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(5, 19), // (5,19): error CS8506: No best type was found for the switch expression. @@ -518,7 +518,7 @@ public static void M() {} public delegate void D(); }"; CreatePatternCompilation(source).VerifyDiagnostics( - // (5,19): warning CS8409: The switch expression does not handle all possible inputs (it is not exhaustive). + // (5,19): warning CS8409: The switch expression does not handle all possible values of its input type (it is not exhaustive). // var x = 1 switch { 0 => M, 1 => new D(M), 2 => M }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(5, 19) ); @@ -609,7 +609,7 @@ public static void Main() }"; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (7,19): warning CS8409: The switch expression does not handle all possible inputs (it is not exhaustive). + // (7,19): warning CS8409: The switch expression does not handle all possible values of its input type (it is not exhaustive). // var c = a switch { var x2 when x2 is var x3 => x3 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 19) ); diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests3.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests3.cs index 244f6d56bfeec..0b85d77fe0da5 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests3.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests3.cs @@ -542,7 +542,7 @@ ref int M(bool b, ref int x, ref int y) }"; var compilation = CreateCompilationWithMscorlibAndSpan(source, options: TestOptions.DebugDll); compilation.VerifyDiagnostics( - // (6,23): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (6,23): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // return ref (b switch { true => ref x, false => ref y }); Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(6, 23), // (6,40): error CS1525: Invalid expression term 'ref' diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests4.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests4.cs index ecec734cded52..551964f9e47b1 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests4.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/PatternMatchingTests4.cs @@ -1776,7 +1776,7 @@ static int M1(bool? b1, bool? b2) "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (6,25): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (6,25): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // return (b1, b2) switch { Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(6, 25) ); @@ -2048,7 +2048,7 @@ static void Main() "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (9,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = t switch { (3, 4) => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 19) ); @@ -2091,7 +2091,7 @@ public SwitchExpressionException() {} "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (9,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = t switch { (3, 4) => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 19) ); @@ -2134,7 +2134,7 @@ public class SwitchExpressionException : InvalidOperationException "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (9,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = t switch { (3, 4) => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 19) ); @@ -2176,7 +2176,7 @@ public class SwitchExpressionException : InvalidOperationException "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (8,24): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (8,24): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = (1, 2) switch { (3, 4) => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(8, 24) ); @@ -2223,7 +2223,7 @@ public SwitchExpressionException() {} "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (9,19): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (9,19): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = r switch { (3, 4) => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(9, 19) ); @@ -2815,7 +2815,7 @@ public static void Main() "; var compilation = CreatePatternCompilation(source, options: TestOptions.ReleaseExe); compilation.VerifyDiagnostics( - // (7,32): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (7,32): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // Console.Write((x, 300) switch { ((1, int x2), int y) => x2+y }); Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(7, 32) ); @@ -2891,7 +2891,7 @@ public static void Main() "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (6,15): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (6,15): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // _ = o switch { null => 1 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(6, 15) ); @@ -2930,7 +2930,7 @@ public int M(bool b) "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (22,18): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (22,18): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // return b switch Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(22, 18) ); @@ -3082,7 +3082,7 @@ public class SwitchExpressionException : InvalidOperationException "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (17,23): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (17,23): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // return (x, y) switch { (1, 2) => 3 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(17, 23) ); @@ -3218,7 +3218,7 @@ public class SwitchExpressionException : InvalidOperationException "; var compilation = CreatePatternCompilation(source); compilation.VerifyDiagnostics( - // (17,44): warning CS8509: The switch expression does not handle all possible inputs (it is not exhaustive). + // (17,44): warning CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive). // return (x, y, a, b, c, d, e, f, g) switch { (1, 2, _, _, _, _, _, _, _) => 3 }; Diagnostic(ErrorCode.WRN_SwitchExpressionNotExhaustive, "switch").WithLocation(17, 44) );