113 references to WRN_CmpAlwaysFalse
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
304case ErrorCode.WRN_CmpAlwaysFalse: 914or ErrorCode.WRN_CmpAlwaysFalse
Generated\ErrorFacts.Generated.cs (1)
40case ErrorCode.WRN_CmpAlwaysFalse:
Lowering\DiagnosticsPass_Warnings.cs (2)
800Error(ErrorCode.WRN_CmpAlwaysFalse, node, GetTypeForLiftedComparisonWarning(node.Right)); 804Error(ErrorCode.WRN_CmpAlwaysFalse, node, GetTypeForLiftedComparisonWarning(node.Left));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
CodeGen\CodeGenOptimizedNullableOperators.cs (8)
1135Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((int?)null) < new decimal?()").WithArguments("decimal?"), 1138Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((S?)null) < new S?()").WithArguments("S?")); 1415Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16), 1418Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16) 1430Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((int?)null) < new decimal?(N3())").WithArguments("int?").WithLocation(29, 16), 1439Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((S?)null) < new S?(N4())").WithArguments("S?").WithLocation(41, 16) 1597Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((int?)null) < N3()").WithArguments("int?"), 1600Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "((S?)null) < N4()").WithArguments("S?")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (100)
Semantics\SemanticErrorTests.cs (100)
20651Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i < null").WithArguments("int?"), 20654Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i <= null").WithArguments("int?"), 20657Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i > null").WithArguments("int?"), 20660Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i >= null").WithArguments("int?"), 20663Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n < null").WithArguments("int?"), 20666Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n <= null").WithArguments("int?"), 20669Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n > null").WithArguments("int?"), 20672Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n >= null").WithArguments("int?"), 20675Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s < null").WithArguments("MyClass.S?"), 20678Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s <= null").WithArguments("MyClass.S?"), 20681Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s > null").WithArguments("MyClass.S?"), 20684Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s >= null").WithArguments("MyClass.S?"), 20687Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t < null").WithArguments("MyClass.S?"), 20690Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t <= null").WithArguments("MyClass.S?"), 20693Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t > null").WithArguments("MyClass.S?"), 20696Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t >= null").WithArguments("MyClass.S?"), 20699Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i < default(short?)").WithArguments("short?"), 20702Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i <= default(short?)").WithArguments("short?"), 20705Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i > default(short?)").WithArguments("short?"), 20708Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i >= default(short?)").WithArguments("short?"), 20711Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n < default(short?)").WithArguments("short?"), 20714Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n <= default(short?)").WithArguments("short?"), 20717Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n > default(short?)").WithArguments("short?"), 20720Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n >= default(short?)").WithArguments("short?"), 20723Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s < default(S?)").WithArguments("MyClass.S?"), 20726Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s <= default(S?)").WithArguments("MyClass.S?"), 20729Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s > default(S?)").WithArguments("MyClass.S?"), 20732Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s >= default(S?)").WithArguments("MyClass.S?"), 20735Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t < default(S?)").WithArguments("MyClass.S?"), 20738Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t <= default(S?)").WithArguments("MyClass.S?"), 20741Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t > default(S?)").WithArguments("MyClass.S?"), 20744Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t >= default(S?)").WithArguments("MyClass.S?"), 20747Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i < new sbyte?()").WithArguments("sbyte?"), 20750Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i <= new sbyte?()").WithArguments("sbyte?"), 20753Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i > new sbyte?()").WithArguments("sbyte?"), 20756Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "i >= new sbyte?()").WithArguments("sbyte?"), 20759Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n < new sbyte?()").WithArguments("sbyte?"), 20762Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n <= new sbyte?()").WithArguments("sbyte?"), 20765Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n > new sbyte?()").WithArguments("sbyte?"), 20768Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "n >= new sbyte?()").WithArguments("sbyte?"), 20771Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s < new S?()").WithArguments("MyClass.S?"), 20774Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s <= new S?()").WithArguments("MyClass.S?"), 20777Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s > new S?()").WithArguments("MyClass.S?"), 20780Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "s >= new S?()").WithArguments("MyClass.S?"), 20783Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t < new S?()").WithArguments("MyClass.S?"), 20786Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t <= new S?()").WithArguments("MyClass.S?"), 20789Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t > new S?()").WithArguments("MyClass.S?"), 20792Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "t >= new S?()").WithArguments("MyClass.S?"), 20795Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null < i").WithArguments("int?"), 20798Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null <= i").WithArguments("int?"), 20801Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null > i").WithArguments("int?"), 20804Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null >= i").WithArguments("int?"), 20807Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null < n").WithArguments("int?"), 20810Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null <= n").WithArguments("int?"), 20813Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null > n").WithArguments("int?"), 20816Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null >= n").WithArguments("int?"), 20819Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null < s").WithArguments("MyClass.S?"), 20822Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null <= s").WithArguments("MyClass.S?"), 20825Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null > s").WithArguments("MyClass.S?"), 20828Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null >= s").WithArguments("MyClass.S?"), 20831Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null < t").WithArguments("MyClass.S?"), 20834Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null <= t").WithArguments("MyClass.S?"), 20837Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null > t").WithArguments("MyClass.S?"), 20840Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null >= t").WithArguments("MyClass.S?"), 20843Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) < i").WithArguments("short?"), 20846Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) <= i").WithArguments("short?"), 20849Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) > i").WithArguments("short?"), 20852Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) >= i").WithArguments("short?"), 20855Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) < n").WithArguments("short?"), 20858Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) <= n").WithArguments("short?"), 20861Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) > n").WithArguments("short?"), 20864Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(short?) >= n").WithArguments("short?"), 20867Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) < s").WithArguments("MyClass.S?"), 20870Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) <= s").WithArguments("MyClass.S?"), 20873Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) > s").WithArguments("MyClass.S?"), 20876Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) >= s").WithArguments("MyClass.S?"), 20879Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) < t").WithArguments("MyClass.S?"), 20882Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) <= t").WithArguments("MyClass.S?"), 20885Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) > t").WithArguments("MyClass.S?"), 20888Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "default(S?) >= t").WithArguments("MyClass.S?"), 20891Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() < i").WithArguments("sbyte?"), 20894Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() <= i").WithArguments("sbyte?"), 20897Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() > i").WithArguments("sbyte?"), 20900Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() >= i").WithArguments("sbyte?"), 20903Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() < n").WithArguments("sbyte?"), 20906Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() <= n").WithArguments("sbyte?"), 20909Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() > n").WithArguments("sbyte?"), 20912Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new sbyte?() > n").WithArguments("sbyte?"), 20915Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() < s").WithArguments("MyClass.S?"), 20918Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() <= s").WithArguments("MyClass.S?"), 20921Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() > s").WithArguments("MyClass.S?"), 20924Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() >= s").WithArguments("MyClass.S?"), 20927Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() < t").WithArguments("MyClass.S?"), 20930Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() <= t").WithArguments("MyClass.S?"), 20933Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() > t").WithArguments("MyClass.S?"), 20936Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "new S?() > t").WithArguments("MyClass.S?"), 20939Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null > null").WithArguments("int?"), 20942Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null >= null").WithArguments("int?"), 20945Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null < null").WithArguments("int?"), 20948Diagnostic(ErrorCode.WRN_CmpAlwaysFalse, "null <= null").WithArguments("int?")