62 references to WRN_IsPatternAlways
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Patterns.cs (1)
86
diagnostics.Add(ErrorCode.
WRN_IsPatternAlways
, node.Location, expression.Type);
Errors\ErrorFacts.cs (2)
494
case ErrorCode.
WRN_IsPatternAlways
:
2067
or ErrorCode.
WRN_IsPatternAlways
Generated\ErrorFacts.Generated.cs (1)
248
case ErrorCode.
WRN_IsPatternAlways
:
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (10)
CodeGen\PatternTests.cs (10)
6964
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is I or null").WithArguments("A").WithLocation(19, 18),
6967
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is null or I").WithArguments("A").WithLocation(20, 18),
6970
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is A or null").WithArguments("A").WithLocation(22, 18),
6973
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is I or (null and null)").WithArguments("A").WithLocation(23, 18),
6976
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is (I or null) and var x").WithArguments("A").WithLocation(26, 9));
7044
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is I or null").WithArguments("A").WithLocation(19, 18),
7047
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is null or I").WithArguments("A").WithLocation(20, 18),
7050
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is A or null").WithArguments("A").WithLocation(22, 18),
7053
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is I or (null and null)").WithArguments("A").WithLocation(23, 18),
7056
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "a is (I or null) and var x").WithArguments("A").WithLocation(26, 9));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (40)
Semantics\PatternMatchingTests.cs (10)
6767
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is ({} and var x) and Span<int> inner").WithArguments("System.Span<int>").WithLocation(8, 13),
7165
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { Prop: var _ and {} and var x }").WithArguments("R").WithLocation(14, 13),
7171
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { Prop: var _ and {} and R x }").WithArguments("R").WithLocation(20, 13),
7177
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (var _ and {} and var x, var _ and {} and var y)").WithArguments("R").WithLocation(26, 13),
7183
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (var _ and {} and R x, var _ and {} and R y)").WithArguments("R").WithLocation(32, 13),
7189
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and var (x, y)").WithArguments("R").WithLocation(38, 13),
7195
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { } x").WithArguments("R").WithLocation(44, 13),
7201
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (_, _) x").WithArguments("R").WithLocation(50, 13),
8893
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, @"chars is """" or not """"").WithArguments("System.ReadOnlySpan<char>").WithLocation(16, 35));
10508
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, @"chars is """" or not """"").WithArguments("System.Span<char>").WithLocation(18, 35));
Semantics\PatternMatchingTests_ListPatterns.cs (3)
2823
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..var y]").WithArguments("S").WithLocation(2, 5),
2826
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..]").WithArguments("S").WithLocation(5, 5),
2829
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..[..]]").WithArguments("S").WithLocation(6, 5),
Semantics\PatternMatchingTests2.cs (5)
2656
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is >= int.MinValue").WithArguments("int").WithLocation(6, 13),
2659
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is <= int.MaxValue").WithArguments("int").WithLocation(8, 13),
2662
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is >= 0").WithArguments("uint").WithLocation(13, 13),
2665
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is <= uint.MaxValue").WithArguments("uint").WithLocation(15, 13)
2756
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is string or null").WithArguments("string").WithLocation(7, 13)
Semantics\PatternMatchingTests3.cs (1)
2019
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is object or (1 or var y7)").WithArguments("object").WithLocation(25, 13),
Semantics\PatternMatchingTests4.cs (21)
4902
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is (not A) or (not B)").WithArguments("object").WithLocation(6, 5),
5000
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is not Derived or A").WithArguments("object").WithLocation(3, 5),
5009
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is A or not Derived").WithArguments("object").WithLocation(9, 5),
5050
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is var x1 or not A or B").WithArguments("object").WithLocation(2, 5),
5056
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is var x2 or not (A or B)").WithArguments("object").WithLocation(3, 5),
5772
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is not null or _").WithArguments("int[]").WithLocation(3, 5),
5775
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is (not null) or _").WithArguments("int[]").WithLocation(4, 5));
5941
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is string or not string { }").WithArguments("object").WithLocation(2, 5),
5944
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is not string or string { }").WithArguments("object").WithLocation(3, 5),
6047
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "o is not (1 and not int x2)").WithArguments("object").WithLocation(8, 13),
6059
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c is not (Derived and null)").WithArguments("C").WithLocation(15, 13),
6137
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is { Prop1: (not 42 or 43) or 44 } or { Prop2: (not 45 or 45) or 46 }").WithArguments("S").WithLocation(7, 13),
7243
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is {} and {}").WithArguments("S").WithLocation(3, 5),
7246
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is {} and {} x2").WithArguments("S").WithLocation(5, 5),
7249
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is { } and { Prop: _ }").WithArguments("S").WithLocation(7, 5));
7342
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c is not object or (int x4, int y4)").WithArguments("C").WithLocation(13, 5),
7351
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c is not object or (int, int)").WithArguments("C").WithLocation(14, 5));
8149
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is 1 or 2 or not 1").WithArguments("int").WithLocation(3, 5),
8763
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s2 is [.. S { Prop: int x }]").WithArguments("S2").WithLocation(2, 5));
9184
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is [..object slice5]").WithArguments("S").WithLocation(19, 5),
9187
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "s is [..Base slice6]").WithArguments("S").WithLocation(22, 5));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\NullableReferenceTypesTests.cs (2)
52587
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c?.M0(out obj) is true or var x").WithArguments("bool?").WithLocation(17, 13),
52596
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c?.M0(out obj) is _ or true").WithArguments("bool?").WithLocation(24, 13),
Semantics\NullableReferenceTypesVsPatterns.cs (4)
2233
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is not null or _").WithArguments("C").WithLocation(18, 13),
2239
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is null or _").WithArguments("C").WithLocation(24, 13),
2245
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is _ or not null").WithArguments("C").WithLocation(30, 13),
2251
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is _ or null").WithArguments("C").WithLocation(36, 13),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\DiagnosticTest.cs (2)
389
case ErrorCode.
WRN_IsPatternAlways
:
524
ErrorCode.
WRN_IsPatternAlways
,