67 references to ERR_IsPatternImpossible
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Patterns.cs (1)
68
diagnostics.Add(ErrorCode.
ERR_IsPatternImpossible
, node.Location, expression.Type);
Errors\ErrorFacts.cs (1)
1935
or ErrorCode.
ERR_IsPatternImpossible
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (65)
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)
8845
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.ReadOnlySpan<char>").WithLocation(7, 13),
8848
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.ReadOnlySpan<char>").WithLocation(8, 13),
8851
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.ReadOnlySpan<char>").WithLocation(9, 13));
10458
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and "" """).WithArguments("System.Span<char>").WithLocation(7, 13),
10461
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and not """"").WithArguments("System.Span<char>").WithLocation(8, 13),
10464
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"chars is """" and ("" "" or not """")").WithArguments("System.Span<char>").WithLocation(9, 13));
Semantics\PatternMatchingTests_ListPatterns.cs (25)
2647
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [] and [1]").WithArguments("int[]").WithLocation(7, 13),
2653
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:0} and [1]").WithArguments("int[]").WithLocation(9, 13),
2656
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [1,2,3] and [1,2,4]").WithArguments("int[]").WithLocation(11, 13),
2668
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is ([>0]) and ([<0])").WithArguments("int[]").WithLocation(13, 13),
2674
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [>0] and [<0]").WithArguments("int[]").WithLocation(15, 13),
2680
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is {Length:-1}").WithArguments("int[]").WithLocation(17, 13),
2683
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [.., >0] and [<0]").WithArguments("int[]").WithLocation(18, 13),
2686
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { a } is { a.Length:-1 }").WithArguments("<anonymous type: int[] a>").WithLocation(20, 13),
2689
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: -1 }]").WithArguments("int[]").WithLocation(21, 13),
2692
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: < -1 }]").WithArguments("int[]").WithLocation(22, 13),
2695
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [..{ Length: <= -1 }]").WithArguments("int[]").WithLocation(23, 13),
2704
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(26, 13),
2710
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: >= int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(28, 13),
2716
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [_, _, ..{ Length: > int.MaxValue - 1 }]").WithArguments("int[]").WithLocation(30, 13)
2782
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Count: -1 }").WithArguments("T").WithLocation(30, 13),
2785
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Count: -1 }").WithArguments("<anonymous type: T t>").WithLocation(31, 13),
2788
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(36, 13),
2791
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(37, 13),
2794
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "t is { Length: -1 }").WithArguments("T").WithLocation(42, 13),
2797
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new { t } is { t.Length: -1 }").WithArguments("<anonymous type: T t>").WithLocation(44, 13)
2832
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new S() is not [..]").WithArguments("S").WithLocation(7, 5)
3135
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is [not {} y, .. not {} z] x").WithArguments("int[]").WithLocation(13, 13),
7669
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7742
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "a is { Length: -1 } or { Length: -1 }").WithArguments("int[]").WithLocation(3, 5),
7768
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),
169
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (1, 4) { x: 3 }").WithArguments("(int x, int y)").WithLocation(13, 22),
175
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "p is (3, 4) { x: 1 }").WithArguments("(int x, int y)").WithLocation(15, 22)
1381
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"""frog"" is string { Length: 4, Length: 5 }").WithArguments("string").WithLocation(5, 34)
2618
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < int.MinValue").WithArguments("int").WithLocation(5, 13),
2621
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > int.MaxValue").WithArguments("int").WithLocation(7, 13),
2624
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is < 0").WithArguments("uint").WithLocation(12, 13),
2627
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is > uint.MaxValue").WithArguments("uint").WithLocation(14, 13)
2689
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not _").WithArguments("string").WithLocation(6, 13),
2692
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, @"s is ""a"" and ""b""").WithArguments("string").WithLocation(7, 13)
Semantics\PatternMatchingTests4.cs (19)
5947
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "o is not (not string or string { })").WithArguments("object").WithLocation(4, 5));
6989
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [_, ..] }").WithArguments("object").WithLocation(6, 5),
6992
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [_, .._] }").WithArguments("object").WithLocation(7, 5),
6995
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [var s2, ..var s3] }").WithArguments("object").WithLocation(8, 5),
6998
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [..var s4, var s5] }").WithArguments("object").WithLocation(9, 5));
7115
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [_, ..] }").WithArguments("object").WithLocation(6, 5),
7118
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [_, .._] }").WithArguments("object").WithLocation(7, 5),
7121
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [var s2, ..var s3] }").WithArguments("object").WithLocation(8, 5),
7124
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is S { P: [] and [..var s4, var s5] }").WithArguments("object").WithLocation(9, 5));
7213
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is (_, _, _) and (_, _)").WithArguments("System.Runtime.CompilerServices.ITuple").WithLocation(24, 5),
7216
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is (_, _, _) and (_, var s7)").WithArguments("System.Runtime.CompilerServices.ITuple").WithLocation(25, 5),
7219
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is { Length: 3 } and (_, _)").WithArguments("System.Runtime.CompilerServices.ITuple").WithLocation(26, 5));
7287
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not { Prop1: _ }").WithArguments("S").WithLocation(10, 5),
7290
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not (_, _)").WithArguments("S").WithLocation(12, 5),
7293
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is not (var x4, var x5)").WithArguments("S").WithLocation(13, 5));
8155
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "i is not (1 or 2 or not 1)").WithArguments("int").WithLocation(6, 5),
8936
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "s is { P: string and null }").WithArguments("S").WithLocation(3, 5),
8942
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "c is { P: string and null }").WithArguments("C").WithLocation(8, 5),
9126
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "o is string x11 and not string").WithArguments("object").WithLocation(35, 5),
Semantics\PatternMatchingTests5.cs (2)
177
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new C() is { Prop1: null } and { Prop1.Prop2: null }").WithArguments("C").WithLocation(9, 13),
180
Diagnostic(ErrorCode.
ERR_IsPatternImpossible
, "new C() is { Prop1: null, Prop1.Prop2: null }").WithArguments("C").WithLocation(10, 13)