61 references to WRN_AlwaysNull
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder_Operators.cs (1)
3858Error(diagnostics, ErrorCode.WRN_AlwaysNull, node, targetType);
Errors\ErrorFacts.cs (2)
290case ErrorCode.WRN_AlwaysNull: 846case 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?")); 1977Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?() + new long?()").WithArguments("long?"), 1980Diagnostic(ErrorCode.WRN_AlwaysNull, "(short?)null * default(decimal?)").WithArguments("decimal?")); 2104Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?() + N()").WithArguments("int?"), 2107Diagnostic(ErrorCode.WRN_AlwaysNull, "new int?(B()) * default(int?)").WithArguments("int?"));
CodeGen\CodeGenTupleTest.cs (1)
25485Diagnostic(ErrorCode.WRN_AlwaysNull, "(1, 1) as (int, long)?").WithArguments("(int, long)?").WithLocation(7, 17)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (41)
Semantics\NullableTests.cs (1)
2054Diagnostic(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), 10932Diagnostic(ErrorCode.WRN_AlwaysNull, "((System.TypeCode)0) as int?").WithArguments("int?").WithLocation(15, 15), 10935Diagnostic(ErrorCode.WRN_AlwaysNull, "0 as long?").WithArguments("long?").WithLocation(18, 15), 10938Diagnostic(ErrorCode.WRN_AlwaysNull, "0 as ulong?").WithArguments("ulong?").WithLocation(19, 15), 10941Diagnostic(ErrorCode.WRN_AlwaysNull, "GetNullableInt() as long?").WithArguments("long?").WithLocation(20, 15)
Semantics\SemanticErrorTests.cs (35)
12262Diagnostic(ErrorCode.WRN_AlwaysNull, "(int?)null + x").WithArguments("int?").WithLocation(7, 23) 20168Diagnostic(ErrorCode.WRN_AlwaysNull, "null + x").WithArguments("int?"), 20169Diagnostic(ErrorCode.WRN_AlwaysNull, "x + default(int?)").WithArguments("int?"), 20170Diagnostic(ErrorCode.WRN_AlwaysNull, "x += new int?()").WithArguments("int?"), 20172Diagnostic(ErrorCode.WRN_AlwaysNull, "null - x").WithArguments("int?"), 20173Diagnostic(ErrorCode.WRN_AlwaysNull, "x - default(int?)").WithArguments("int?"), 20174Diagnostic(ErrorCode.WRN_AlwaysNull, "x -= new int?()").WithArguments("int?"), 20176Diagnostic(ErrorCode.WRN_AlwaysNull, "null * x").WithArguments("int?"), 20177Diagnostic(ErrorCode.WRN_AlwaysNull, "x * default(int?)").WithArguments("int?"), 20178Diagnostic(ErrorCode.WRN_AlwaysNull, "x *= new int?()").WithArguments("int?"), 20180Diagnostic(ErrorCode.WRN_AlwaysNull, "null / x").WithArguments("int?"), 20181Diagnostic(ErrorCode.WRN_AlwaysNull, "x / default(int?)").WithArguments("int?"), 20182Diagnostic(ErrorCode.WRN_AlwaysNull, "x /= new int?()").WithArguments("int?"), 20184Diagnostic(ErrorCode.WRN_AlwaysNull, "null % x").WithArguments("int?"), 20185Diagnostic(ErrorCode.WRN_AlwaysNull, "x % default(int?)").WithArguments("int?"), 20186Diagnostic(ErrorCode.WRN_AlwaysNull, "x %= new int?()").WithArguments("int?"), 20188Diagnostic(ErrorCode.WRN_AlwaysNull, "null << x").WithArguments("int?"), 20189Diagnostic(ErrorCode.WRN_AlwaysNull, "x << default(int?)").WithArguments("int?"), 20190Diagnostic(ErrorCode.WRN_AlwaysNull, "x <<= new int?()").WithArguments("int?"), 20192Diagnostic(ErrorCode.WRN_AlwaysNull, "null >> x").WithArguments("int?"), 20193Diagnostic(ErrorCode.WRN_AlwaysNull, "x >> default(int?)").WithArguments("int?"), 20194Diagnostic(ErrorCode.WRN_AlwaysNull, "x >>= new int?()").WithArguments("int?"), 20196Diagnostic(ErrorCode.WRN_AlwaysNull, "null & x").WithArguments("int?"), 20197Diagnostic(ErrorCode.WRN_AlwaysNull, "x & default(int?)").WithArguments("int?"), 20198Diagnostic(ErrorCode.WRN_AlwaysNull, "x &= new int?()").WithArguments("int?"), 20200Diagnostic(ErrorCode.WRN_AlwaysNull, "null | x").WithArguments("int?"), 20201Diagnostic(ErrorCode.WRN_AlwaysNull, "x | default(int?)").WithArguments("int?"), 20202Diagnostic(ErrorCode.WRN_AlwaysNull, "x |= new int?()").WithArguments("int?"), 20204Diagnostic(ErrorCode.WRN_AlwaysNull, "null ^ x").WithArguments("int?"), 20205Diagnostic(ErrorCode.WRN_AlwaysNull, "x ^ default(int?)").WithArguments("int?"), 20206Diagnostic(ErrorCode.WRN_AlwaysNull, "x ^= new int?()").WithArguments("int?"), 20208Diagnostic(ErrorCode.WRN_AlwaysNull, "+default(double?)").WithArguments("double?"), 20209Diagnostic(ErrorCode.WRN_AlwaysNull, "-default(int?)").WithArguments("int?"), 20210Diagnostic(ErrorCode.WRN_AlwaysNull, "~default(long?)").WithArguments("long?"), 20211Diagnostic(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[] { KeyValuePairUtil.Create($"CS{(int)ErrorCode.WRN_AlwaysNull:D4}", ReportDiagnostic.Suppress) })); 44var d2 = SimpleDiagnostic.Create(MessageProvider.Instance, (int)ErrorCode.WRN_AlwaysNull, "1");