134 references to WRN_SwitchExpressionNotExhaustive
Microsoft.CodeAnalysis.CSharp (4)
Binder\SwitchExpressionBinder.cs (1)
99
ErrorCode.
WRN_SwitchExpressionNotExhaustive
;
Errors\ErrorFacts.cs (2)
450
case ErrorCode.
WRN_SwitchExpressionNotExhaustive
:
1869
case ErrorCode.
WRN_SwitchExpressionNotExhaustive
:
Generated\ErrorFacts.Generated.cs (1)
187
case ErrorCode.
WRN_SwitchExpressionNotExhaustive
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\PatternTests.cs (2)
3319
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("0").WithLocation(9, 38)
3347
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("0").WithLocation(9, 38)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (122)
Emit\NumericIntPtrTests.cs (3)
10728
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("> (nint)int.MaxValue").WithLocation(3, 7),
10731
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("< (nint)int.MinValue").WithLocation(8, 7),
10734
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("> (nuint)uint.MaxValue").WithLocation(14, 7)
Semantics\PatternMatchingTests_ListPatterns.cs (30)
5040
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[not null]").WithLocation(27, 7),
5046
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[not null]").WithLocation(49, 7),
5055
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 0 }").WithLocation(80, 7),
5131
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[.. not null, _]").WithLocation(27, 18)
5169
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(12, 18)
5264
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(27, 18),
5267
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(33, 18),
5807
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 2 }").WithLocation(2, 13),
5810
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 1 }").WithLocation(9, 13),
5813
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 1 }").WithLocation(16, 13)
5820
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 2 }").WithLocation(2, 13),
5829
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 1 }").WithLocation(9, 13),
5838
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 1 }").WithLocation(16, 13),
5894
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Count: 0 }").WithLocation(2, 13),
5897
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[0]").WithLocation(8, 13)
5970
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[_, 0]").WithLocation(2, 13)
5994
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[0, _]").WithLocation(2, 13)
6033
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[0]").WithLocation(2, 13),
6036
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[_, _, 0]").WithLocation(9, 13),
6039
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("[1, _, 0]").WithLocation(16, 13)
6063
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 0 }").WithLocation(2, 13)
6131
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(2, 13)
7500
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(7, 7),
7506
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 0 }").WithLocation(12, 7),
7509
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 0 }").WithLocation(17, 7),
7512
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 0 }").WithLocation(22, 7),
7536
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("not null").WithLocation(5, 7),
7590
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(5, 7),
7820
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 2, Count: 0 }").WithLocation(2, 13)
8937
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 1000 }").WithLocation(2, 7));
Semantics\PatternMatchingTests2.cs (2)
605
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(5, 19),
629
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("3").WithLocation(5, 19)
Semantics\PatternMatchingTests3.cs (55)
1629
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("1").WithLocation(5, 41),
1650
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("1").WithLocation(5, 41),
2477
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("0").WithLocation(14, 15),
2925
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("E.Five").WithLocation(15, 28)
2982
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("E.Five").WithLocation(15, 28)
5540
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("0").WithLocation(7, 21),
5543
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("0").WithLocation(15, 17)
5567
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Color.Greed").WithLocation(4, 33)
5589
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Color.Blue").WithLocation(4, 33)
5729
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(false, false)").WithLocation(4, 37)
5760
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(not null, _)").WithLocation(11, 20),
5763
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(not null, not null)").WithLocation(12, 20),
5795
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("> (nint)int.MaxValue").WithLocation(4, 25),
5798
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("< (nint)int.MinValue").WithLocation(5, 25),
5801
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("> (nuint)uint.MaxValue").WithLocation(6, 26)
5824
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("float.NaN").WithLocation(4, 26),
5827
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("float.NegativeInfinity").WithLocation(5, 26),
5830
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("float.PositiveInfinity").WithLocation(6, 26),
5833
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("double.NaN").WithLocation(7, 27),
5836
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("double.NegativeInfinity").WithLocation(8, 27),
5839
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("double.PositiveInfinity").WithLocation(9, 27)
5857
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("\"B\"").WithLocation(4, 27)
6864
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q(1, 2.5D)").WithLocation(4, 27),
6867
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q(1L, 2.5F)").WithLocation(5, 27),
6870
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q((byte)1, (short)2)").WithLocation(6, 27),
6873
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q(1U, 2UL)").WithLocation(7, 27),
6876
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q(1L, (sbyte)2)").WithLocation(8, 27)
6905
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("I").WithLocation(4, 27),
6908
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q(1, 2.5D) and (3, 4, 5) { P1: 1, P2: 2 }").WithLocation(5, 27)
6933
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("not null").WithLocation(5, 23)
6957
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(1, 2)").WithLocation(4, 35),
6960
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(1, 2)").WithLocation(5, 35),
6966
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("not null").WithLocation(7, 36)
6990
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ P1: 10 }").WithLocation(4, 22),
6993
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ P1: -100 }").WithLocation(5, 22)
7017
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ P1: 10 }").WithLocation(4, 22),
7020
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ P1: -100 }").WithLocation(5, 22)
7042
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q").WithLocation(4, 27),
7045
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("Q").WithLocation(5, 27),
7048
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("W").WithLocation(6, 27)
7071
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(1) { }").WithLocation(4, 22),
7074
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(1) { }").WithLocation(5, 43)
7101
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(false, true, false, true)").WithLocation(4, 44)
7128
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(4, 26)
7162
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ A: false, B: true, C: false, D: true }").WithLocation(4, 21)
7196
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ A: false, D: true, B: true, C: false }").WithLocation(4, 21)
7229
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments(@"(0, ""A"")").WithLocation(4, 21)
7253
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(1) { } and (2, 3)").WithLocation(4, 22),
7256
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(2, 3) and (1) { }").WithLocation(5, 22)
7277
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments(@"""0""").WithLocation(3, 33)
7300
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments(@"""20""").WithLocation(3, 33)
7319
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Length: 1 }").WithLocation(3, 33)
7365
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ x: 1, y: 2, Extra: 3 }").WithLocation(3, 41)
7457
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(14, 31));
7492
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("1").WithLocation(14, 31));
Semantics\PatternMatchingTests4.cs (15)
1806
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(true, false)").WithLocation(6, 25)
2088
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2224
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2229
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2379
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2424
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(8, 24)
2429
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(8, 24)
2578
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2619
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
2627
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(9, 19)
3218
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("((0, _), _)").WithLocation(7, 32)
3294
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("not null").WithLocation(6, 15)
3333
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("false").WithLocation(22, 18)
3511
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _)").WithLocation(17, 23)
3647
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(0, _, _, _, _, _, _, _, _)").WithLocation(17, 44)
Semantics\PatternMatchingTests5.cs (17)
721
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ BProp: { BoolProp: false } }").WithLocation(6, 15),
724
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ BProp: { IntProp: 1 } }").WithLocation(11, 15)
1918
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Prop: { True: false } }").WithLocation(2, 13),
1921
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("{ Prop: { Prop: not null } }").WithLocation(14, 13)
2649
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One)").WithLocation(12, 25)
2876
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, \"A\")").WithLocation(29, 28),
2888
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(87, 28)
3048
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, false)").WithLocation(60, 21),
3051
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(76, 21),
3054
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(90, 21),
3057
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(105, 21),
3068
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, false)").WithLocation(60, 21),
3071
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(76, 21),
3074
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(90, 21),
3077
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, _)").WithLocation(105, 21),
3136
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, false)").WithLocation(12, 28),
3147
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("(Enum.One, Enum.One, false)").WithLocation(12, 28)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_ISwitchExpression.cs (1)
147
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(7, 25)
IOperation\IOperationTests_ISwitchOperation.cs (1)
3346
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(6, 19),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\LambdaTests.cs (1)
4744
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(5, 26));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (3)
Diagnostics\DiagnosticTest.cs (1)
282
case ErrorCode.
WRN_SwitchExpressionNotExhaustive
:
Parsing\PatternParsingTests.cs (1)
2468
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(1, 32),
Parsing\StatementAttributeParsingTests.cs (1)
6271
Diagnostic(ErrorCode.
WRN_SwitchExpressionNotExhaustive
, "switch").WithArguments("_").WithLocation(6, 14),