113 references to WRN_CmpAlwaysFalse
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
291
case ErrorCode.
WRN_CmpAlwaysFalse
:
850
case ErrorCode.
WRN_CmpAlwaysFalse
:
Generated\ErrorFacts.Generated.cs (1)
40
case ErrorCode.
WRN_CmpAlwaysFalse
:
Lowering\DiagnosticsPass_Warnings.cs (2)
800
Error(ErrorCode.
WRN_CmpAlwaysFalse
, node, GetTypeForLiftedComparisonWarning(node.Right));
804
Error(ErrorCode.
WRN_CmpAlwaysFalse
, node, GetTypeForLiftedComparisonWarning(node.Left));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
CodeGen\CodeGenOptimizedNullableOperators.cs (8)
827
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?()").WithArguments("decimal?"),
830
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?()").WithArguments("S?"));
1107
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16),
1110
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16)
1122
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16),
1131
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16)
1289
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < N3()").WithArguments("int?"),
1292
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < N4()").WithArguments("S?")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (100)
Semantics\SemanticErrorTests.cs (100)
20380
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < null").WithArguments("int?"),
20383
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= null").WithArguments("int?"),
20386
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > null").WithArguments("int?"),
20389
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= null").WithArguments("int?"),
20392
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < null").WithArguments("int?"),
20395
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= null").WithArguments("int?"),
20398
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > null").WithArguments("int?"),
20401
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= null").WithArguments("int?"),
20404
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < null").WithArguments("MyClass.S?"),
20407
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= null").WithArguments("MyClass.S?"),
20410
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > null").WithArguments("MyClass.S?"),
20413
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= null").WithArguments("MyClass.S?"),
20416
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < null").WithArguments("MyClass.S?"),
20419
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= null").WithArguments("MyClass.S?"),
20422
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > null").WithArguments("MyClass.S?"),
20425
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= null").WithArguments("MyClass.S?"),
20428
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < default(short?)").WithArguments("short?"),
20431
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= default(short?)").WithArguments("short?"),
20434
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > default(short?)").WithArguments("short?"),
20437
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= default(short?)").WithArguments("short?"),
20440
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < default(short?)").WithArguments("short?"),
20443
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= default(short?)").WithArguments("short?"),
20446
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > default(short?)").WithArguments("short?"),
20449
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= default(short?)").WithArguments("short?"),
20452
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < default(S?)").WithArguments("MyClass.S?"),
20455
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= default(S?)").WithArguments("MyClass.S?"),
20458
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > default(S?)").WithArguments("MyClass.S?"),
20461
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= default(S?)").WithArguments("MyClass.S?"),
20464
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < default(S?)").WithArguments("MyClass.S?"),
20467
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= default(S?)").WithArguments("MyClass.S?"),
20470
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > default(S?)").WithArguments("MyClass.S?"),
20473
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= default(S?)").WithArguments("MyClass.S?"),
20476
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < new sbyte?()").WithArguments("sbyte?"),
20479
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= new sbyte?()").WithArguments("sbyte?"),
20482
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > new sbyte?()").WithArguments("sbyte?"),
20485
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= new sbyte?()").WithArguments("sbyte?"),
20488
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < new sbyte?()").WithArguments("sbyte?"),
20491
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= new sbyte?()").WithArguments("sbyte?"),
20494
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > new sbyte?()").WithArguments("sbyte?"),
20497
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= new sbyte?()").WithArguments("sbyte?"),
20500
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < new S?()").WithArguments("MyClass.S?"),
20503
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= new S?()").WithArguments("MyClass.S?"),
20506
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > new S?()").WithArguments("MyClass.S?"),
20509
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= new S?()").WithArguments("MyClass.S?"),
20512
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < new S?()").WithArguments("MyClass.S?"),
20515
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= new S?()").WithArguments("MyClass.S?"),
20518
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > new S?()").WithArguments("MyClass.S?"),
20521
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= new S?()").WithArguments("MyClass.S?"),
20524
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < i").WithArguments("int?"),
20527
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= i").WithArguments("int?"),
20530
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > i").WithArguments("int?"),
20533
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= i").WithArguments("int?"),
20536
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < n").WithArguments("int?"),
20539
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= n").WithArguments("int?"),
20542
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > n").WithArguments("int?"),
20545
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= n").WithArguments("int?"),
20548
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < s").WithArguments("MyClass.S?"),
20551
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= s").WithArguments("MyClass.S?"),
20554
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > s").WithArguments("MyClass.S?"),
20557
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= s").WithArguments("MyClass.S?"),
20560
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < t").WithArguments("MyClass.S?"),
20563
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= t").WithArguments("MyClass.S?"),
20566
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > t").WithArguments("MyClass.S?"),
20569
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= t").WithArguments("MyClass.S?"),
20572
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < i").WithArguments("short?"),
20575
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= i").WithArguments("short?"),
20578
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > i").WithArguments("short?"),
20581
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= i").WithArguments("short?"),
20584
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < n").WithArguments("short?"),
20587
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= n").WithArguments("short?"),
20590
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > n").WithArguments("short?"),
20593
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= n").WithArguments("short?"),
20596
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < s").WithArguments("MyClass.S?"),
20599
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= s").WithArguments("MyClass.S?"),
20602
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > s").WithArguments("MyClass.S?"),
20605
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= s").WithArguments("MyClass.S?"),
20608
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < t").WithArguments("MyClass.S?"),
20611
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= t").WithArguments("MyClass.S?"),
20614
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > t").WithArguments("MyClass.S?"),
20617
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= t").WithArguments("MyClass.S?"),
20620
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < i").WithArguments("sbyte?"),
20623
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= i").WithArguments("sbyte?"),
20626
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > i").WithArguments("sbyte?"),
20629
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() >= i").WithArguments("sbyte?"),
20632
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < n").WithArguments("sbyte?"),
20635
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= n").WithArguments("sbyte?"),
20638
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20641
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20644
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < s").WithArguments("MyClass.S?"),
20647
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= s").WithArguments("MyClass.S?"),
20650
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > s").WithArguments("MyClass.S?"),
20653
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() >= s").WithArguments("MyClass.S?"),
20656
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < t").WithArguments("MyClass.S?"),
20659
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= t").WithArguments("MyClass.S?"),
20662
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20665
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20668
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > null").WithArguments("int?"),
20671
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= null").WithArguments("int?"),
20674
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < null").WithArguments("int?"),
20677
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= null").WithArguments("int?")