113 references to WRN_CmpAlwaysFalse
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
304
case ErrorCode.
WRN_CmpAlwaysFalse
:
914
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)
20651
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < null").WithArguments("int?"),
20654
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= null").WithArguments("int?"),
20657
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > null").WithArguments("int?"),
20660
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= null").WithArguments("int?"),
20663
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < null").WithArguments("int?"),
20666
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= null").WithArguments("int?"),
20669
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > null").WithArguments("int?"),
20672
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= null").WithArguments("int?"),
20675
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < null").WithArguments("MyClass.S?"),
20678
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= null").WithArguments("MyClass.S?"),
20681
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > null").WithArguments("MyClass.S?"),
20684
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= null").WithArguments("MyClass.S?"),
20687
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < null").WithArguments("MyClass.S?"),
20690
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= null").WithArguments("MyClass.S?"),
20693
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > null").WithArguments("MyClass.S?"),
20696
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= null").WithArguments("MyClass.S?"),
20699
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < default(short?)").WithArguments("short?"),
20702
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= default(short?)").WithArguments("short?"),
20705
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > default(short?)").WithArguments("short?"),
20708
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= default(short?)").WithArguments("short?"),
20711
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < default(short?)").WithArguments("short?"),
20714
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= default(short?)").WithArguments("short?"),
20717
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > default(short?)").WithArguments("short?"),
20720
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= default(short?)").WithArguments("short?"),
20723
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < default(S?)").WithArguments("MyClass.S?"),
20726
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= default(S?)").WithArguments("MyClass.S?"),
20729
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > default(S?)").WithArguments("MyClass.S?"),
20732
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= default(S?)").WithArguments("MyClass.S?"),
20735
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < default(S?)").WithArguments("MyClass.S?"),
20738
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= default(S?)").WithArguments("MyClass.S?"),
20741
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > default(S?)").WithArguments("MyClass.S?"),
20744
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= default(S?)").WithArguments("MyClass.S?"),
20747
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < new sbyte?()").WithArguments("sbyte?"),
20750
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= new sbyte?()").WithArguments("sbyte?"),
20753
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > new sbyte?()").WithArguments("sbyte?"),
20756
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= new sbyte?()").WithArguments("sbyte?"),
20759
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < new sbyte?()").WithArguments("sbyte?"),
20762
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= new sbyte?()").WithArguments("sbyte?"),
20765
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > new sbyte?()").WithArguments("sbyte?"),
20768
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= new sbyte?()").WithArguments("sbyte?"),
20771
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < new S?()").WithArguments("MyClass.S?"),
20774
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= new S?()").WithArguments("MyClass.S?"),
20777
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > new S?()").WithArguments("MyClass.S?"),
20780
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= new S?()").WithArguments("MyClass.S?"),
20783
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < new S?()").WithArguments("MyClass.S?"),
20786
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= new S?()").WithArguments("MyClass.S?"),
20789
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > new S?()").WithArguments("MyClass.S?"),
20792
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= new S?()").WithArguments("MyClass.S?"),
20795
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < i").WithArguments("int?"),
20798
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= i").WithArguments("int?"),
20801
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > i").WithArguments("int?"),
20804
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= i").WithArguments("int?"),
20807
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < n").WithArguments("int?"),
20810
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= n").WithArguments("int?"),
20813
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > n").WithArguments("int?"),
20816
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= n").WithArguments("int?"),
20819
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < s").WithArguments("MyClass.S?"),
20822
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= s").WithArguments("MyClass.S?"),
20825
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > s").WithArguments("MyClass.S?"),
20828
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= s").WithArguments("MyClass.S?"),
20831
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < t").WithArguments("MyClass.S?"),
20834
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= t").WithArguments("MyClass.S?"),
20837
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > t").WithArguments("MyClass.S?"),
20840
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= t").WithArguments("MyClass.S?"),
20843
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < i").WithArguments("short?"),
20846
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= i").WithArguments("short?"),
20849
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > i").WithArguments("short?"),
20852
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= i").WithArguments("short?"),
20855
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < n").WithArguments("short?"),
20858
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= n").WithArguments("short?"),
20861
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > n").WithArguments("short?"),
20864
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= n").WithArguments("short?"),
20867
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < s").WithArguments("MyClass.S?"),
20870
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= s").WithArguments("MyClass.S?"),
20873
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > s").WithArguments("MyClass.S?"),
20876
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= s").WithArguments("MyClass.S?"),
20879
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < t").WithArguments("MyClass.S?"),
20882
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= t").WithArguments("MyClass.S?"),
20885
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > t").WithArguments("MyClass.S?"),
20888
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= t").WithArguments("MyClass.S?"),
20891
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < i").WithArguments("sbyte?"),
20894
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= i").WithArguments("sbyte?"),
20897
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > i").WithArguments("sbyte?"),
20900
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() >= i").WithArguments("sbyte?"),
20903
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < n").WithArguments("sbyte?"),
20906
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= n").WithArguments("sbyte?"),
20909
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20912
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20915
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < s").WithArguments("MyClass.S?"),
20918
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= s").WithArguments("MyClass.S?"),
20921
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > s").WithArguments("MyClass.S?"),
20924
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() >= s").WithArguments("MyClass.S?"),
20927
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < t").WithArguments("MyClass.S?"),
20930
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= t").WithArguments("MyClass.S?"),
20933
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20936
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20939
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > null").WithArguments("int?"),
20942
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= null").WithArguments("int?"),
20945
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < null").WithArguments("int?"),
20948
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= null").WithArguments("int?")