48 references to ERR_IsPatternImpossible
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Patterns.cs (1)
66
diagnostics.Add(ErrorCode.
ERR_IsPatternImpossible
, node.Location, expression.Type);
Errors\ErrorFacts.cs (1)
1878
case ErrorCode.
ERR_IsPatternImpossible
:
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (46)
FlowAnalysis\FlowTests.cs (1)
4555
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "(b && M0(x = y = 0)) is true and false").WithArguments("bool").WithLocation(28, 13),
Semantics\PatternMatchingTests.cs (6)
8838
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.ReadOnlySpan<char>").WithLocation(7, 13),
8841
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.ReadOnlySpan<char>").WithLocation(8, 13),
8844
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.ReadOnlySpan<char>").WithLocation(9, 13));
10438
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.Span<char>").WithLocation(7, 13),
10441
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.Span<char>").WithLocation(8, 13),
10444
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.Span<char>").WithLocation(9, 13));
Semantics\PatternMatchingTests_ListPatterns.cs (25)
2648
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [] and [1]").WithArguments("int[]").WithLocation(7, 13),
2651
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:0} and [1]").WithArguments("int[]").WithLocation(9, 13),
2654
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [1,2,3] and [1,2,4]").WithArguments("int[]").WithLocation(11, 13),
2657
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is ([>0]) and ([<0])").WithArguments("int[]").WithLocation(13, 13),
2660
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [>0] and [<0]").WithArguments("int[]").WithLocation(15, 13),
2663
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:-1}").WithArguments("int[]").WithLocation(17, 13),
2666
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [.., >0] and [<0]").WithArguments("int[]").WithLocation(18, 13),
2668
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { a } is { a.Length:-1 }").WithArguments("<anonymous type: int[] a>").WithLocation(20, 13),
2671
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: -1 }]").WithArguments("int[]").WithLocation(21, 13),
2674
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: < -1 }]").WithArguments("int[]").WithLocation(22, 13),
2677
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: <= -1 }]").WithArguments("int[]").WithLocation(23, 13),
2680
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(26, 13),
2683
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: >= int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(28, 13),
2686
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: > int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(30, 13)
2752
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Count: -1 }").WithArguments("T").WithLocation(30, 13),
2755
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Count: -1 }").WithArguments("<anonymous type: T t>").WithLocation(31, 13),
2758
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(36, 13),
2761
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(37, 13),
2764
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(42, 13),
2767
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(44, 13)
2802
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new S() is not [..]").WithArguments("S").WithLocation(7, 5)
3074
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [not {} y, .. not {} z] x").WithArguments("int[]").WithLocation(13, 13),
7497
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7561
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 } or { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7587
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: < 0 }").WithArguments("int[]").WithLocation(3, 5),
Semantics\PatternMatchingTests2.cs (12)
161
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (1, 4) { x: 3 }").WithArguments("(int x, int y)").WithLocation(9, 22),
164
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 1) { y: 4 }").WithArguments("(int x, int y)").WithLocation(10, 22),
167
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 4) { x: 1 }").WithArguments("(int x, int y)").WithLocation(11, 22),
170
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (1, 4) { x: 3 }").WithArguments("(int x, int y)").WithLocation(13, 22),
173
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 4) { x: 1 }").WithArguments("(int x, int y)").WithLocation(15, 22)
1368
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"""frog"" is string { Length: 4, Length: 5 }").WithArguments("string").WithLocation(5, 34)
2605
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < int.MinValue").WithArguments("int").WithLocation(5, 13),
2608
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > int.MaxValue").WithArguments("int").WithLocation(7, 13),
2611
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < 0").WithArguments("uint").WithLocation(12, 13),
2614
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > uint.MaxValue").WithArguments("uint").WithLocation(14, 13)
2676
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not _").WithArguments("string").WithLocation(6, 13),
2679
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"s is ""a"" and ""b""").WithArguments("string").WithLocation(7, 13)
Semantics\PatternMatchingTests5.cs (2)
176
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new C() is { Prop1: null } and { Prop1.Prop2: null }").WithArguments("C").WithLocation(9, 13),
179
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new C() is { Prop1: null, Prop1.Prop2: null }").WithArguments("C").WithLocation(10, 13)