113 references to WRN_CmpAlwaysFalse
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
309
case ErrorCode.
WRN_CmpAlwaysFalse
:
924
or ErrorCode.
WRN_CmpAlwaysFalse
Generated\ErrorFacts.Generated.cs (1)
40
case ErrorCode.
WRN_CmpAlwaysFalse
:
Lowering\DiagnosticsPass_Warnings.cs (2)
799
Error(ErrorCode.
WRN_CmpAlwaysFalse
, node, GetTypeForLiftedComparisonWarning(node.Right));
803
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)
20674
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < null").WithArguments("int?"),
20677
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= null").WithArguments("int?"),
20680
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > null").WithArguments("int?"),
20683
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= null").WithArguments("int?"),
20686
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < null").WithArguments("int?"),
20689
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= null").WithArguments("int?"),
20692
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > null").WithArguments("int?"),
20695
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= null").WithArguments("int?"),
20698
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < null").WithArguments("MyClass.S?"),
20701
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= null").WithArguments("MyClass.S?"),
20704
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > null").WithArguments("MyClass.S?"),
20707
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= null").WithArguments("MyClass.S?"),
20710
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < null").WithArguments("MyClass.S?"),
20713
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= null").WithArguments("MyClass.S?"),
20716
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > null").WithArguments("MyClass.S?"),
20719
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= null").WithArguments("MyClass.S?"),
20722
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < default(short?)").WithArguments("short?"),
20725
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= default(short?)").WithArguments("short?"),
20728
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > default(short?)").WithArguments("short?"),
20731
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= default(short?)").WithArguments("short?"),
20734
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < default(short?)").WithArguments("short?"),
20737
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= default(short?)").WithArguments("short?"),
20740
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > default(short?)").WithArguments("short?"),
20743
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= default(short?)").WithArguments("short?"),
20746
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < default(S?)").WithArguments("MyClass.S?"),
20749
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= default(S?)").WithArguments("MyClass.S?"),
20752
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > default(S?)").WithArguments("MyClass.S?"),
20755
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= default(S?)").WithArguments("MyClass.S?"),
20758
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < default(S?)").WithArguments("MyClass.S?"),
20761
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= default(S?)").WithArguments("MyClass.S?"),
20764
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > default(S?)").WithArguments("MyClass.S?"),
20767
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= default(S?)").WithArguments("MyClass.S?"),
20770
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i < new sbyte?()").WithArguments("sbyte?"),
20773
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i <= new sbyte?()").WithArguments("sbyte?"),
20776
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i > new sbyte?()").WithArguments("sbyte?"),
20779
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "i >= new sbyte?()").WithArguments("sbyte?"),
20782
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n < new sbyte?()").WithArguments("sbyte?"),
20785
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n <= new sbyte?()").WithArguments("sbyte?"),
20788
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n > new sbyte?()").WithArguments("sbyte?"),
20791
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "n >= new sbyte?()").WithArguments("sbyte?"),
20794
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s < new S?()").WithArguments("MyClass.S?"),
20797
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s <= new S?()").WithArguments("MyClass.S?"),
20800
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s > new S?()").WithArguments("MyClass.S?"),
20803
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "s >= new S?()").WithArguments("MyClass.S?"),
20806
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t < new S?()").WithArguments("MyClass.S?"),
20809
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t <= new S?()").WithArguments("MyClass.S?"),
20812
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t > new S?()").WithArguments("MyClass.S?"),
20815
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "t >= new S?()").WithArguments("MyClass.S?"),
20818
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < i").WithArguments("int?"),
20821
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= i").WithArguments("int?"),
20824
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > i").WithArguments("int?"),
20827
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= i").WithArguments("int?"),
20830
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < n").WithArguments("int?"),
20833
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= n").WithArguments("int?"),
20836
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > n").WithArguments("int?"),
20839
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= n").WithArguments("int?"),
20842
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < s").WithArguments("MyClass.S?"),
20845
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= s").WithArguments("MyClass.S?"),
20848
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > s").WithArguments("MyClass.S?"),
20851
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= s").WithArguments("MyClass.S?"),
20854
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < t").WithArguments("MyClass.S?"),
20857
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= t").WithArguments("MyClass.S?"),
20860
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > t").WithArguments("MyClass.S?"),
20863
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= t").WithArguments("MyClass.S?"),
20866
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < i").WithArguments("short?"),
20869
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= i").WithArguments("short?"),
20872
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > i").WithArguments("short?"),
20875
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= i").WithArguments("short?"),
20878
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) < n").WithArguments("short?"),
20881
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) <= n").WithArguments("short?"),
20884
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) > n").WithArguments("short?"),
20887
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(short?) >= n").WithArguments("short?"),
20890
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < s").WithArguments("MyClass.S?"),
20893
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= s").WithArguments("MyClass.S?"),
20896
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > s").WithArguments("MyClass.S?"),
20899
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= s").WithArguments("MyClass.S?"),
20902
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) < t").WithArguments("MyClass.S?"),
20905
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) <= t").WithArguments("MyClass.S?"),
20908
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) > t").WithArguments("MyClass.S?"),
20911
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "default(S?) >= t").WithArguments("MyClass.S?"),
20914
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < i").WithArguments("sbyte?"),
20917
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= i").WithArguments("sbyte?"),
20920
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > i").WithArguments("sbyte?"),
20923
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() >= i").WithArguments("sbyte?"),
20926
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() < n").WithArguments("sbyte?"),
20929
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() <= n").WithArguments("sbyte?"),
20932
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20935
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new sbyte?() > n").WithArguments("sbyte?"),
20938
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < s").WithArguments("MyClass.S?"),
20941
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= s").WithArguments("MyClass.S?"),
20944
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > s").WithArguments("MyClass.S?"),
20947
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() >= s").WithArguments("MyClass.S?"),
20950
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() < t").WithArguments("MyClass.S?"),
20953
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() <= t").WithArguments("MyClass.S?"),
20956
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20959
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "new S?() > t").WithArguments("MyClass.S?"),
20962
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null > null").WithArguments("int?"),
20965
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null >= null").WithArguments("int?"),
20968
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null < null").WithArguments("int?"),
20971
Diagnostic(ErrorCode.
WRN_CmpAlwaysFalse
, "null <= null").WithArguments("int?")