48 references to ERR_IsPatternImpossible
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Patterns.cs (1)
67
diagnostics.Add(ErrorCode.
ERR_IsPatternImpossible
, node.Location, expression.Type);
Errors\ErrorFacts.cs (1)
1935
or ErrorCode.
ERR_IsPatternImpossible
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (46)
FlowAnalysis\FlowTests.cs (1)
4556
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "(b && M0(x = y = 0)) is true and false").WithArguments("bool").WithLocation(28, 13),
Semantics\PatternMatchingTests.cs (6)
8841
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.ReadOnlySpan<char>").WithLocation(7, 13),
8844
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.ReadOnlySpan<char>").WithLocation(8, 13),
8847
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.ReadOnlySpan<char>").WithLocation(9, 13));
10442
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.Span<char>").WithLocation(7, 13),
10445
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.Span<char>").WithLocation(8, 13),
10448
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.Span<char>").WithLocation(9, 13));
Semantics\PatternMatchingTests_ListPatterns.cs (25)
2646
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [] and [1]").WithArguments("int[]").WithLocation(7, 13),
2649
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:0} and [1]").WithArguments("int[]").WithLocation(9, 13),
2652
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [1,2,3] and [1,2,4]").WithArguments("int[]").WithLocation(11, 13),
2655
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is ([>0]) and ([<0])").WithArguments("int[]").WithLocation(13, 13),
2658
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [>0] and [<0]").WithArguments("int[]").WithLocation(15, 13),
2661
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:-1}").WithArguments("int[]").WithLocation(17, 13),
2664
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [.., >0] and [<0]").WithArguments("int[]").WithLocation(18, 13),
2666
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { a } is { a.Length:-1 }").WithArguments("<anonymous type: int[] a>").WithLocation(20, 13),
2669
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: -1 }]").WithArguments("int[]").WithLocation(21, 13),
2672
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: < -1 }]").WithArguments("int[]").WithLocation(22, 13),
2675
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: <= -1 }]").WithArguments("int[]").WithLocation(23, 13),
2678
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(26, 13),
2681
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: >= int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(28, 13),
2684
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: > int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(30, 13)
2750
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Count: -1 }").WithArguments("T").WithLocation(30, 13),
2753
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Count: -1 }").WithArguments("<anonymous type: T t>").WithLocation(31, 13),
2756
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(36, 13),
2759
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(37, 13),
2762
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(42, 13),
2765
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(44, 13)
2800
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new S() is not [..]").WithArguments("S").WithLocation(7, 5)
3072
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [not {} y, .. not {} z] x").WithArguments("int[]").WithLocation(13, 13),
7490
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7554
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 } or { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7580
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: < 0 }").WithArguments("int[]").WithLocation(3, 5),
Semantics\PatternMatchingTests2.cs (12)
157
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (1, 4) { x: 3 }").WithArguments("(int x, int y)").WithLocation(9, 22),
160
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 1) { y: 4 }").WithArguments("(int x, int y)").WithLocation(10, 22),
163
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 4) { x: 1 }").WithArguments("(int x, int y)").WithLocation(11, 22),
166
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (1, 4) { x: 3 }").WithArguments("(int x, int y)").WithLocation(13, 22),
169
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 4) { x: 1 }").WithArguments("(int x, int y)").WithLocation(15, 22)
1364
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"""frog"" is string { Length: 4, Length: 5 }").WithArguments("string").WithLocation(5, 34)
2601
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < int.MinValue").WithArguments("int").WithLocation(5, 13),
2604
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > int.MaxValue").WithArguments("int").WithLocation(7, 13),
2607
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < 0").WithArguments("uint").WithLocation(12, 13),
2610
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > uint.MaxValue").WithArguments("uint").WithLocation(14, 13)
2672
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not _").WithArguments("string").WithLocation(6, 13),
2675
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)