31 references to WRN_IsPatternAlways
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Patterns.cs (1)
84
diagnostics.Add(ErrorCode.
WRN_IsPatternAlways
, node.Location, expression.Type);
Errors\ErrorFacts.cs (2)
495
case ErrorCode.
WRN_IsPatternAlways
:
2067
or ErrorCode.
WRN_IsPatternAlways
Generated\ErrorFacts.Generated.cs (1)
249
case ErrorCode.
WRN_IsPatternAlways
:
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (19)
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),
7161
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { Prop: var _ and {} and var x }").WithArguments("R").WithLocation(14, 13),
7167
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { Prop: var _ and {} and R x }").WithArguments("R").WithLocation(20, 13),
7173
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (var _ and {} and var x, var _ and {} and var y)").WithArguments("R").WithLocation(26, 13),
7179
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (var _ and {} and R x, var _ and {} and R y)").WithArguments("R").WithLocation(32, 13),
7185
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and var (x, y)").WithArguments("R").WithLocation(38, 13),
7191
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and { } x").WithArguments("R").WithLocation(44, 13),
7197
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "outer is var _ and {} and (_, _) x").WithArguments("R").WithLocation(50, 13),
8877
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, @"chars is """" or not """"").WithArguments("System.ReadOnlySpan<char>").WithLocation(16, 35));
10480
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, @"chars is """" or not """"").WithArguments("System.Span<char>").WithLocation(18, 35));
Semantics\PatternMatchingTests_ListPatterns.cs (3)
2791
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..var y]").WithArguments("S").WithLocation(2, 5),
2794
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..]").WithArguments("S").WithLocation(5, 5),
2797
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "new S() is [..[..]]").WithArguments("S").WithLocation(6, 5),
Semantics\PatternMatchingTests2.cs (5)
2639
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is >= int.MinValue").WithArguments("int").WithLocation(6, 13),
2642
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is <= int.MaxValue").WithArguments("int").WithLocation(8, 13),
2645
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is >= 0").WithArguments("uint").WithLocation(13, 13),
2648
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "i is <= uint.MaxValue").WithArguments("uint").WithLocation(15, 13)
2739
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),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\NullableReferenceTypesTests.cs (2)
52552
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c?.M0(out obj) is true or var x").WithArguments("bool?").WithLocation(17, 13),
52561
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "c?.M0(out obj) is _ or true").WithArguments("bool?").WithLocation(24, 13),
Semantics\NullableReferenceTypesVsPatterns.cs (4)
2221
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is not null or _").WithArguments("C").WithLocation(18, 13),
2227
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is null or _").WithArguments("C").WithLocation(24, 13),
2233
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is _ or not null").WithArguments("C").WithLocation(30, 13),
2239
Diagnostic(ErrorCode.
WRN_IsPatternAlways
, "x is _ or null").WithArguments("C").WithLocation(36, 13),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
Diagnostics\DiagnosticTest.cs (2)
401
case ErrorCode.
WRN_IsPatternAlways
:
525
ErrorCode.
WRN_IsPatternAlways
,