61 references to WRN_AlwaysNull
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder_Operators.cs (1)
5357Error(diagnostics, ErrorCode.WRN_AlwaysNull, node, targetType);
Errors\ErrorFacts.cs (2)
303case ErrorCode.WRN_AlwaysNull: 908or ErrorCode.WRN_AlwaysNull
Generated\ErrorFacts.Generated.cs (1)
39case ErrorCode.WRN_AlwaysNull:
Lowering\DiagnosticsPass_Warnings.cs (5)
729Error(ErrorCode.WRN_AlwaysNull, node, node.Type); 745Error(ErrorCode.WRN_AlwaysNull, node, node.Type); 830Error(ErrorCode.WRN_AlwaysNull, node, node.Type); 836Error(ErrorCode.WRN_AlwaysNull, node, node.Type); 847Error(ErrorCode.WRN_AlwaysNull, node, node.Type);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
BreakingChanges.cs (1)
950Diagnostic(ErrorCode.WRN_AlwaysNull, "ct & null ^ null").WithArguments("bool?") //,
CodeGen\CodeGenOptimizedNullableOperators.cs (6)
320Diagnostic(ErrorCode.WRN_AlwaysNull, "~(new int?())").WithArguments("int?")); 363Diagnostic(ErrorCode.WRN_AlwaysNull, "-(new short?())").WithArguments("int?")); 2285Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?() + new long?()").WithArguments("long?"), 2288Diagnostic(ErrorCode.WRN_AlwaysNull, "(short?)null * default(decimal?)").WithArguments("decimal?")); 2412Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?() + N()").WithArguments("int?"), 2415Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?(B()) * default(int?)").WithArguments("int?"));
CodeGen\CodeGenTupleTest.cs (1)
25447Diagnostic(ErrorCode.WRN_AlwaysNull, "(1, 1) as (int, long)?").WithArguments("(int, long)?").WithLocation(7, 17)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (41)
Semantics\NullableTests.cs (1)
2050Diagnostic(ErrorCode.WRN_AlwaysNull, "xn0 - null").WithArguments("int?").WithLocation(9, 28)
Semantics\OperatorTests.cs (5)
1939Diagnostic(ErrorCode.WRN_AlwaysNull, "new Q<int>?() + new int?()").WithArguments("int?").WithLocation(37, 18), 11574Diagnostic(ErrorCode.WRN_AlwaysNull, "((System.TypeCode)0) as int?").WithArguments("int?").WithLocation(15, 15), 11577Diagnostic(ErrorCode.WRN_AlwaysNull, "0 as long?").WithArguments("long?").WithLocation(18, 15), 11580Diagnostic(ErrorCode.WRN_AlwaysNull, "0 as ulong?").WithArguments("ulong?").WithLocation(19, 15), 11583Diagnostic(ErrorCode.WRN_AlwaysNull, "GetNullableInt() as long?").WithArguments("long?").WithLocation(20, 15)
Semantics\SemanticErrorTests.cs (35)
12312Diagnostic(ErrorCode.WRN_AlwaysNull, "(int?)null + x").WithArguments("int?").WithLocation(7, 23) 20392Diagnostic(ErrorCode.WRN_AlwaysNull, "null + x").WithArguments("int?"), 20393Diagnostic(ErrorCode.WRN_AlwaysNull, "x + default(int?)").WithArguments("int?"), 20394Diagnostic(ErrorCode.WRN_AlwaysNull, "x += new int?()").WithArguments("int?"), 20396Diagnostic(ErrorCode.WRN_AlwaysNull, "null - x").WithArguments("int?"), 20397Diagnostic(ErrorCode.WRN_AlwaysNull, "x - default(int?)").WithArguments("int?"), 20398Diagnostic(ErrorCode.WRN_AlwaysNull, "x -= new int?()").WithArguments("int?"), 20400Diagnostic(ErrorCode.WRN_AlwaysNull, "null * x").WithArguments("int?"), 20401Diagnostic(ErrorCode.WRN_AlwaysNull, "x * default(int?)").WithArguments("int?"), 20402Diagnostic(ErrorCode.WRN_AlwaysNull, "x *= new int?()").WithArguments("int?"), 20404Diagnostic(ErrorCode.WRN_AlwaysNull, "null / x").WithArguments("int?"), 20405Diagnostic(ErrorCode.WRN_AlwaysNull, "x / default(int?)").WithArguments("int?"), 20406Diagnostic(ErrorCode.WRN_AlwaysNull, "x /= new int?()").WithArguments("int?"), 20408Diagnostic(ErrorCode.WRN_AlwaysNull, "null % x").WithArguments("int?"), 20409Diagnostic(ErrorCode.WRN_AlwaysNull, "x % default(int?)").WithArguments("int?"), 20410Diagnostic(ErrorCode.WRN_AlwaysNull, "x %= new int?()").WithArguments("int?"), 20412Diagnostic(ErrorCode.WRN_AlwaysNull, "null << x").WithArguments("int?"), 20413Diagnostic(ErrorCode.WRN_AlwaysNull, "x << default(int?)").WithArguments("int?"), 20414Diagnostic(ErrorCode.WRN_AlwaysNull, "x <<= new int?()").WithArguments("int?"), 20416Diagnostic(ErrorCode.WRN_AlwaysNull, "null >> x").WithArguments("int?"), 20417Diagnostic(ErrorCode.WRN_AlwaysNull, "x >> default(int?)").WithArguments("int?"), 20418Diagnostic(ErrorCode.WRN_AlwaysNull, "x >>= new int?()").WithArguments("int?"), 20420Diagnostic(ErrorCode.WRN_AlwaysNull, "null & x").WithArguments("int?"), 20421Diagnostic(ErrorCode.WRN_AlwaysNull, "x & default(int?)").WithArguments("int?"), 20422Diagnostic(ErrorCode.WRN_AlwaysNull, "x &= new int?()").WithArguments("int?"), 20424Diagnostic(ErrorCode.WRN_AlwaysNull, "null | x").WithArguments("int?"), 20425Diagnostic(ErrorCode.WRN_AlwaysNull, "x | default(int?)").WithArguments("int?"), 20426Diagnostic(ErrorCode.WRN_AlwaysNull, "x |= new int?()").WithArguments("int?"), 20428Diagnostic(ErrorCode.WRN_AlwaysNull, "null ^ x").WithArguments("int?"), 20429Diagnostic(ErrorCode.WRN_AlwaysNull, "x ^ default(int?)").WithArguments("int?"), 20430Diagnostic(ErrorCode.WRN_AlwaysNull, "x ^= new int?()").WithArguments("int?"), 20432Diagnostic(ErrorCode.WRN_AlwaysNull, "+default(double?)").WithArguments("double?"), 20433Diagnostic(ErrorCode.WRN_AlwaysNull, "-default(int?)").WithArguments("int?"), 20434Diagnostic(ErrorCode.WRN_AlwaysNull, "~default(long?)").WithArguments("long?"), 20435Diagnostic(ErrorCode.WRN_AlwaysNull, "!default(bool?)").WithArguments("bool?")
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\EnumTests.cs (1)
571Diagnostic(ErrorCode.WRN_AlwaysNull, "null & MyEnum.One").WithArguments("MyEnum?")
Microsoft.CodeAnalysis.UnitTests (2)
Diagnostics\CompilationWithAnalyzersTests.cs (2)
41new[] { KeyValuePair.Create($"CS{(int)ErrorCode.WRN_AlwaysNull:D4}", ReportDiagnostic.Suppress) })); 44var d2 = SimpleDiagnostic.Create(MessageProvider.Instance, (int)ErrorCode.WRN_AlwaysNull, "1");