23 references to WRN_NubExprIsConstBool2
Microsoft.CodeAnalysis.CSharp (5)
Errors\ErrorFacts.cs (2)
234
case ErrorCode.
WRN_NubExprIsConstBool2
:
1701
or ErrorCode.
WRN_NubExprIsConstBool2
Generated\ErrorFacts.Generated.cs (1)
173
case ErrorCode.
WRN_NubExprIsConstBool2
:
Lowering\DiagnosticsPass_Warnings.cs (2)
818
Error(node.OperatorKind.IsUserDefined() ? ErrorCode.
WRN_NubExprIsConstBool2
: ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Right));
822
Error(node.OperatorKind.IsUserDefined() ? ErrorCode.
WRN_NubExprIsConstBool2
: ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Left));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenOptimizedNullableOperators.cs (2)
1433
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "new S?() == new S?(N4())").WithArguments("false", "S", "S?").WithLocation(33, 16),
1436
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "default(S?) != new S?(N4())").WithArguments("true", "S", "S?").WithLocation(37, 16),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (15)
Semantics\SemanticErrorTests.cs (13)
21055
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g == null").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(23, 11),
21058
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g != null").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(24, 11),
21067
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g == default(Guid?)").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(32, 11),
21070
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g != default(Guid?)").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(33, 11),
21079
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g == new Guid?()").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(41, 11),
21082
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "g != new Guid?()").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(42, 11),
21091
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "null == g").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(53, 11),
21094
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "null != g").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(54, 11),
21103
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "default(Guid?) == g").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(62, 11),
21106
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "default(Guid?) != g").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(63, 11),
21115
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "new Guid?() == g").WithArguments("false", "System.Guid", "System.Guid?").WithLocation(71, 11),
21118
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "new Guid?() != g").WithArguments("true", "System.Guid", "System.Guid?").WithLocation(72, 11),
21144
var compatibleExpected = fullExpected.Where(d => !d.Code.Equals((int)ErrorCode.
WRN_NubExprIsConstBool2
)).ToArray();
Semantics\WarningVersionTests.cs (2)
43
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "s == null").WithArguments("false", "S", "S?").WithLocation(6, 13),
46
Diagnostic(ErrorCode.
WRN_NubExprIsConstBool2
, "s != null").WithArguments("true", "S", "S?").WithLocation(7, 13)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Diagnostics\DiagnosticTest.cs (1)
445
case ErrorCode.
WRN_NubExprIsConstBool2
: