113 references to WRN_CmpAlwaysFalse
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
304
case ErrorCode.
WRN_CmpAlwaysFalse
:
912
or 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)
1135
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?()").WithArguments("decimal?"),
1138
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?()").WithArguments("S?"));
1415
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16),
1418
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16)
1430
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16),
1439
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16)
1597
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((int?)null) < N3()").WithArguments("int?"),
1600
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "((S?)null) < N4()").WithArguments("S?")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (100)
Semantics\SemanticErrorTests.cs (100)
20604
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < null").WithArguments("int?"),
20607
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= null").WithArguments("int?"),
20610
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > null").WithArguments("int?"),
20613
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= null").WithArguments("int?"),
20616
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < null").WithArguments("int?"),
20619
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= null").WithArguments("int?"),
20622
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > null").WithArguments("int?"),
20625
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= null").WithArguments("int?"),
20628
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < null").WithArguments("MyClass.S?"),
20631
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= null").WithArguments("MyClass.S?"),
20634
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > null").WithArguments("MyClass.S?"),
20637
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= null").WithArguments("MyClass.S?"),
20640
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < null").WithArguments("MyClass.S?"),
20643
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= null").WithArguments("MyClass.S?"),
20646
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > null").WithArguments("MyClass.S?"),
20649
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= null").WithArguments("MyClass.S?"),
20652
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < default(short?)").WithArguments("short?"),
20655
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= default(short?)").WithArguments("short?"),
20658
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > default(short?)").WithArguments("short?"),
20661
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= default(short?)").WithArguments("short?"),
20664
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < default(short?)").WithArguments("short?"),
20667
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= default(short?)").WithArguments("short?"),
20670
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > default(short?)").WithArguments("short?"),
20673
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= default(short?)").WithArguments("short?"),
20676
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < default(S?)").WithArguments("MyClass.S?"),
20679
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= default(S?)").WithArguments("MyClass.S?"),
20682
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > default(S?)").WithArguments("MyClass.S?"),
20685
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= default(S?)").WithArguments("MyClass.S?"),
20688
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < default(S?)").WithArguments("MyClass.S?"),
20691
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= default(S?)").WithArguments("MyClass.S?"),
20694
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > default(S?)").WithArguments("MyClass.S?"),
20697
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= default(S?)").WithArguments("MyClass.S?"),
20700
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < new sbyte?()").WithArguments("sbyte?"),
20703
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= new sbyte?()").WithArguments("sbyte?"),
20706
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > new sbyte?()").WithArguments("sbyte?"),
20709
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= new sbyte?()").WithArguments("sbyte?"),
20712
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < new sbyte?()").WithArguments("sbyte?"),
20715
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= new sbyte?()").WithArguments("sbyte?"),
20718
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > new sbyte?()").WithArguments("sbyte?"),
20721
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= new sbyte?()").WithArguments("sbyte?"),
20724
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < new S?()").WithArguments("MyClass.S?"),
20727
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= new S?()").WithArguments("MyClass.S?"),
20730
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > new S?()").WithArguments("MyClass.S?"),
20733
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= new S?()").WithArguments("MyClass.S?"),
20736
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < new S?()").WithArguments("MyClass.S?"),
20739
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= new S?()").WithArguments("MyClass.S?"),
20742
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > new S?()").WithArguments("MyClass.S?"),
20745
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= new S?()").WithArguments("MyClass.S?"),
20748
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < i").WithArguments("int?"),
20751
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= i").WithArguments("int?"),
20754
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > i").WithArguments("int?"),
20757
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= i").WithArguments("int?"),
20760
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < n").WithArguments("int?"),
20763
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= n").WithArguments("int?"),
20766
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > n").WithArguments("int?"),
20769
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= n").WithArguments("int?"),
20772
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < s").WithArguments("MyClass.S?"),
20775
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= s").WithArguments("MyClass.S?"),
20778
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > s").WithArguments("MyClass.S?"),
20781
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= s").WithArguments("MyClass.S?"),
20784
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < t").WithArguments("MyClass.S?"),
20787
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= t").WithArguments("MyClass.S?"),
20790
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > t").WithArguments("MyClass.S?"),
20793
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= t").WithArguments("MyClass.S?"),
20796
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < i").WithArguments("short?"),
20799
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= i").WithArguments("short?"),
20802
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > i").WithArguments("short?"),
20805
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= i").WithArguments("short?"),
20808
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < n").WithArguments("short?"),
20811
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= n").WithArguments("short?"),
20814
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > n").WithArguments("short?"),
20817
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= n").WithArguments("short?"),
20820
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < s").WithArguments("MyClass.S?"),
20823
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= s").WithArguments("MyClass.S?"),
20826
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > s").WithArguments("MyClass.S?"),
20829
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= s").WithArguments("MyClass.S?"),
20832
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < t").WithArguments("MyClass.S?"),
20835
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= t").WithArguments("MyClass.S?"),
20838
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > t").WithArguments("MyClass.S?"),
20841
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= t").WithArguments("MyClass.S?"),
20844
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < i").WithArguments("sbyte?"),
20847
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= i").WithArguments("sbyte?"),
20850
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > i").WithArguments("sbyte?"),
20853
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() >= i").WithArguments("sbyte?"),
20856
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < n").WithArguments("sbyte?"),
20859
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= n").WithArguments("sbyte?"),
20862
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20865
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20868
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < s").WithArguments("MyClass.S?"),
20871
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= s").WithArguments("MyClass.S?"),
20874
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > s").WithArguments("MyClass.S?"),
20877
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() >= s").WithArguments("MyClass.S?"),
20880
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < t").WithArguments("MyClass.S?"),
20883
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= t").WithArguments("MyClass.S?"),
20886
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20889
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20892
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > null").WithArguments("int?"),
20895
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= null").WithArguments("int?"),
20898
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < null").WithArguments("int?"),
20901
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= null").WithArguments("int?")