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)
20649
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < null").WithArguments("int?"),
20652
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= null").WithArguments("int?"),
20655
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > null").WithArguments("int?"),
20658
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= null").WithArguments("int?"),
20661
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < null").WithArguments("int?"),
20664
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= null").WithArguments("int?"),
20667
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > null").WithArguments("int?"),
20670
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= null").WithArguments("int?"),
20673
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < null").WithArguments("MyClass.S?"),
20676
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= null").WithArguments("MyClass.S?"),
20679
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > null").WithArguments("MyClass.S?"),
20682
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= null").WithArguments("MyClass.S?"),
20685
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < null").WithArguments("MyClass.S?"),
20688
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= null").WithArguments("MyClass.S?"),
20691
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > null").WithArguments("MyClass.S?"),
20694
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= null").WithArguments("MyClass.S?"),
20697
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < default(short?)").WithArguments("short?"),
20700
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= default(short?)").WithArguments("short?"),
20703
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > default(short?)").WithArguments("short?"),
20706
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= default(short?)").WithArguments("short?"),
20709
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < default(short?)").WithArguments("short?"),
20712
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= default(short?)").WithArguments("short?"),
20715
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > default(short?)").WithArguments("short?"),
20718
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= default(short?)").WithArguments("short?"),
20721
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < default(S?)").WithArguments("MyClass.S?"),
20724
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= default(S?)").WithArguments("MyClass.S?"),
20727
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > default(S?)").WithArguments("MyClass.S?"),
20730
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= default(S?)").WithArguments("MyClass.S?"),
20733
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < default(S?)").WithArguments("MyClass.S?"),
20736
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= default(S?)").WithArguments("MyClass.S?"),
20739
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > default(S?)").WithArguments("MyClass.S?"),
20742
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= default(S?)").WithArguments("MyClass.S?"),
20745
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < new sbyte?()").WithArguments("sbyte?"),
20748
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= new sbyte?()").WithArguments("sbyte?"),
20751
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > new sbyte?()").WithArguments("sbyte?"),
20754
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= new sbyte?()").WithArguments("sbyte?"),
20757
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < new sbyte?()").WithArguments("sbyte?"),
20760
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= new sbyte?()").WithArguments("sbyte?"),
20763
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > new sbyte?()").WithArguments("sbyte?"),
20766
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= new sbyte?()").WithArguments("sbyte?"),
20769
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < new S?()").WithArguments("MyClass.S?"),
20772
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= new S?()").WithArguments("MyClass.S?"),
20775
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > new S?()").WithArguments("MyClass.S?"),
20778
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= new S?()").WithArguments("MyClass.S?"),
20781
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < new S?()").WithArguments("MyClass.S?"),
20784
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= new S?()").WithArguments("MyClass.S?"),
20787
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > new S?()").WithArguments("MyClass.S?"),
20790
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= new S?()").WithArguments("MyClass.S?"),
20793
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < i").WithArguments("int?"),
20796
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= i").WithArguments("int?"),
20799
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > i").WithArguments("int?"),
20802
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= i").WithArguments("int?"),
20805
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < n").WithArguments("int?"),
20808
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= n").WithArguments("int?"),
20811
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > n").WithArguments("int?"),
20814
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= n").WithArguments("int?"),
20817
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < s").WithArguments("MyClass.S?"),
20820
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= s").WithArguments("MyClass.S?"),
20823
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > s").WithArguments("MyClass.S?"),
20826
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= s").WithArguments("MyClass.S?"),
20829
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < t").WithArguments("MyClass.S?"),
20832
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= t").WithArguments("MyClass.S?"),
20835
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > t").WithArguments("MyClass.S?"),
20838
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= t").WithArguments("MyClass.S?"),
20841
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < i").WithArguments("short?"),
20844
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= i").WithArguments("short?"),
20847
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > i").WithArguments("short?"),
20850
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= i").WithArguments("short?"),
20853
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < n").WithArguments("short?"),
20856
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= n").WithArguments("short?"),
20859
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > n").WithArguments("short?"),
20862
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= n").WithArguments("short?"),
20865
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < s").WithArguments("MyClass.S?"),
20868
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= s").WithArguments("MyClass.S?"),
20871
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > s").WithArguments("MyClass.S?"),
20874
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= s").WithArguments("MyClass.S?"),
20877
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < t").WithArguments("MyClass.S?"),
20880
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= t").WithArguments("MyClass.S?"),
20883
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > t").WithArguments("MyClass.S?"),
20886
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= t").WithArguments("MyClass.S?"),
20889
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < i").WithArguments("sbyte?"),
20892
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= i").WithArguments("sbyte?"),
20895
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > i").WithArguments("sbyte?"),
20898
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() >= i").WithArguments("sbyte?"),
20901
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < n").WithArguments("sbyte?"),
20904
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= n").WithArguments("sbyte?"),
20907
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20910
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20913
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < s").WithArguments("MyClass.S?"),
20916
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= s").WithArguments("MyClass.S?"),
20919
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > s").WithArguments("MyClass.S?"),
20922
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() >= s").WithArguments("MyClass.S?"),
20925
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < t").WithArguments("MyClass.S?"),
20928
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= t").WithArguments("MyClass.S?"),
20931
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20934
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20937
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > null").WithArguments("int?"),
20940
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= null").WithArguments("int?"),
20943
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < null").WithArguments("int?"),
20946
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= null").WithArguments("int?")