149 references to ERR_NotConstantExpression
Microsoft.CodeAnalysis.CSharp (2)
Errors\ErrorFacts.cs (1)
725
or ErrorCode.
ERR_NotConstantExpression
Symbols\ConstantValueUtils.cs (1)
139
diagnostics.Add(ErrorCode.
ERR_NotConstantExpression
, initValueNode.Location, thisSymbol);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
BreakingChanges.cs (3)
253
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"null ?? ""ABC""").WithArguments("b"),
254
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"""DEF"" ?? null").WithArguments("c"),
255
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(int?)null ?? 123").WithArguments("d"));
CodeGen\CodeGenFieldInitTests.cs (2)
678
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "F2").WithArguments("B.F1").WithLocation(7, 27));
693
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "F2").WithArguments("B.F1").WithLocation(3, 27));
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (1)
3247
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default").WithArguments("C.dateTime").WithLocation(6, 54)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (18)
Emit\NumericIntPtrTests.cs (18)
2234
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked((IntPtr)x)").WithArguments("y").WithLocation(7, 26),
2285
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked((IntPtr)x)").WithArguments("y").WithLocation(7, 26));
8928
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F")
8933
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F")
8935
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
8947
constantDeclaration(opType, declarations, expr, null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F") });
8948
constantDeclaration(opType, declarations, $"checked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F") });
8949
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
8982
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F")
8987
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F")
8989
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
9001
constantDeclaration(opType, declarations, expr, null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F") });
9002
constantDeclaration(opType, declarations, $"checked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F") });
9003
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
9100
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked(uint.MaxValue + (UIntPtr)42)").WithArguments("x").WithLocation(8, 27),
9103
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked(uint.MaxValue + (UIntPtr)42)").WithArguments("y").WithLocation(9, 27),
9167
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked(-(IntPtr)int.MinValue)").WithArguments("x").WithLocation(8, 26),
9170
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked(-(IntPtr)int.MinValue)").WithArguments("y").WithLocation(9, 26),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (36)
Semantics\OutVarTests.cs (16)
5263
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"TakeOutParam(51, out int x5) &&
5268
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(6, out int x6) && x6 > 0 ? 1 : 0").WithArguments("X.Test61").WithLocation(12, 14),
5271
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(6, out int x6) && x6 > 0 ? 1 : 0").WithArguments("X.Test62").WithLocation(12, 70),
5274
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(7, out int x7) && x7 > 0 ? 1 : 0").WithArguments("X.Test71").WithLocation(14, 14),
5280
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(3, out int x3) ? x3 : 0").WithArguments("X.Test3").WithLocation(4, 13)
5381
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(3, out int x3) && x3 > 0").WithArguments("X.Test3").WithLocation(8, 24),
5390
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"TakeOutParam(51, out int x5) &&
5395
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(6, out int x6) && x6 > 0").WithArguments("X.Test61").WithLocation(16, 25),
5398
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(6, out int x6) && x6 > 0").WithArguments("X.Test62").WithLocation(16, 73),
5401
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "TakeOutParam(7, out int x7) && x7 > 0").WithArguments("X.Test71").WithLocation(18, 25),
32023
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "H.TakeOutParam(1, out var x1)").WithArguments("b").WithLocation(3, 20),
32054
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "H.TakeOutParam(1, out var x1)").WithArguments("<invalid-global-code>.b").WithLocation(3, 20),
35034
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M(nameof(M(out var z2)), z2)").WithArguments("C.b").WithLocation(5, 20),
35046
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M(nameof(M(out int z1)), z1)").WithArguments("C.a").WithLocation(4, 20)
35088
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M(nameof(M(out int z1)), z1)").WithArguments("a").WithLocation(6, 24),
35094
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M(nameof(M(out var z2)), z2)").WithArguments("b").WithLocation(7, 24),
Semantics\PatternMatchingTests.cs (2)
3496
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "3 is var x2 ? 3 : 3").WithArguments("S.F2").WithLocation(5, 18),
3499
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "3 is var x1 ? x1 : 3").WithArguments("S.F1").WithLocation(4, 18)
Semantics\PatternMatchingTests_Global.cs (2)
6186
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "H.Dummy(1 is var x1)").WithArguments("b").WithLocation(3, 20),
6224
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "H.Dummy(1 is var x1)").WithArguments("<invalid-global-code>.b").WithLocation(3, 20),
Semantics\PatternMatchingTests_Scope.cs (8)
3430
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "6 is int x6 && x6 > 0 ? 1 : 0").WithArguments("X.Test61").WithLocation(12, 14),
3433
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "6 is int x6 && x6 > 0 ? 1 : 0").WithArguments("X.Test62").WithLocation(12, 54),
3436
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "7 is int x7 && x7 > 0 ? 1 : 0").WithArguments("X.Test71").WithLocation(14, 14),
3442
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "3 is int x3 ? x3 : 0").WithArguments("X.Test3").WithLocation(4, 13)
3508
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "3 is int x3 && x3 > 0").WithArguments("X.Test3").WithLocation(8, 24),
3517
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "6 is int x6 && x6 > 0").WithArguments("X.Test61").WithLocation(16, 25),
3520
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "6 is int x6 && x6 > 0").WithArguments("X.Test62").WithLocation(16, 57),
3523
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "7 is int x7 && x7 > 0").WithArguments("X.Test71").WithLocation(18, 25),
Semantics\PatternMatchingTests3.cs (3)
7454
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "Color.Red.ToArgb()").WithArguments("red").WithLocation(13, 25),
7489
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "Color.Red.ToArgb()").WithArguments("red").WithLocation(13, 25),
7523
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "Color.Red.ToArgb()").WithArguments("red").WithLocation(13, 25));
Semantics\PrimaryConstructorTests.cs (3)
2711
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "X + 1").WithArguments("C.Z").WithLocation(6, 19)
7888
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "p1").WithArguments("C1.F").WithLocation(2000, 1)
7973
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "p1").WithArguments("C1.F").WithLocation(2000, 1)
Semantics\RecordTests.cs (2)
24811
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "X + 1").WithArguments("C.Z").WithLocation(4, 19)
29672
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "P").WithArguments("C2.P").WithLocation(8, 19)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (5)
IOperation\IOperationTests_ISymbolInitializer.cs (2)
621
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M()").WithArguments("C.c1").WithLocation(4, 37)
1001
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "M() ?? M2()").WithArguments("C.c1").WithLocation(4, 37)
IOperation\IOperationTests_IVariableDeclaration.cs (3)
3185
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "GetInt()").WithArguments("i1").WithLocation(6, 34)
3230
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "GetInt()").WithArguments("i1").WithLocation(6, 34),
3233
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "GetInt()").WithArguments("i2").WithLocation(6, 49)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (79)
Semantics\ConstantTests.cs (29)
1725
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "s1").WithArguments("s2").WithLocation(12, 27),
1813
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(dynamic)").WithArguments("C.d0"),
1815
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(dynamic)1").WithArguments("C.d1"),
1817
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(int)(dynamic)1").WithArguments("C.d2"),
1819
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "1 + (int)(dynamic)1").WithArguments("C.d3"));
3314
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "a()").WithArguments("b").WithLocation(6, 51)
3415
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"(string)(object)""y""").WithArguments("y1").WithLocation(7, 27),
3692
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{""Level 5""} {3}""").WithArguments("S2").WithLocation(7, 27),
3695
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{$""{""Spinning Top"", 10}""}""").WithArguments("S3").WithLocation(8, 27),
3698
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{ParamDefault}""").WithArguments("S4").WithLocation(9, 27),
3701
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{I1}""").WithArguments("F1").WithLocation(11, 27),
3704
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{I1} the {S1}""").WithArguments("F2").WithLocation(12, 27));
3728
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{""Level 5""} {3}""""""").WithArguments("S2").WithLocation(7, 27),
3731
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{$""{""Spinning Top"", 10}""}""""""").WithArguments("S3").WithLocation(8, 27),
3734
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{ParamDefault}""""""").WithArguments("S4").WithLocation(9, 27),
3737
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{I1}""""""").WithArguments("F1").WithLocation(11, 27),
3740
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{I1} the {S1}""""""").WithArguments("F2").WithLocation(12, 27));
3810
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"""The"" + $""Number {3}"" + ""Level 5""").WithArguments("S1").WithLocation(8, 27),
3813
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""Level 4 "" + NC1").WithArguments("S2").WithLocation(9, 27),
3816
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""{S1}""").WithArguments("F1").WithLocation(10, 27));
3838
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"""The"" + $""""""Number {3}"""""" + ""Level 5""").WithArguments("S1").WithLocation(8, 27),
3841
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""Level 4 """""" + NC1").WithArguments("S2").WithLocation(9, 27),
3844
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""""""{S1}""""""").WithArguments("F1").WithLocation(10, 27));
3907
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""Failed to {VS}""").WithArguments("S6").WithLocation(34, 27));
3943
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"$""Failed to {VS}""").WithArguments("S6").WithLocation(34, 27),
4077
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"x switch { _ => """" }").WithArguments("x").WithLocation(1, 18));
4116
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "42 switch { _ => x }").WithArguments("x").WithLocation(1, 18),
4172
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "x switch { _ => 42 }").WithArguments("y").WithLocation(1, 41));
4214
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "[x]").WithArguments("x").WithLocation(1, 13),
Semantics\FunctionPointerTests.cs (1)
3796
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "null").WithArguments("C.field").WithLocation(4, 35),
Semantics\ImplicitObjectCreationTests.cs (1)
2539
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "new()").WithArguments("x").WithLocation(6, 26),
Semantics\LambdaTests.cs (1)
886
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "((System.Func<int>)(() => 1))()").WithArguments("TestClass.Test.aa"),
Semantics\NativeIntegerTests.cs (24)
4425
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "sizeof(System.IntPtr)").WithArguments("Program.A").WithLocation(3, 19),
4428
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "sizeof(System.UIntPtr)").WithArguments("Program.B").WithLocation(4, 19),
4431
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "sizeof(nint)").WithArguments("Program.C").WithLocation(5, 19),
4434
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "sizeof(nuint)").WithArguments("Program.D").WithLocation(6, 19));
6369
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked((nint)x)").WithArguments("y").WithLocation(7, 24),
6419
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked((nint)x)").WithArguments("y").WithLocation(7, 24));
6928
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(System.IntPtr)").WithArguments("Program.A").WithLocation(3, 29),
6934
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(System.UIntPtr)").WithArguments("Program.C").WithLocation(5, 30));
13178
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F")
13183
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F")
13185
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
13197
constantDeclaration(opType, declarations, expr, null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F") });
13198
constantDeclaration(opType, declarations, $"checked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F") });
13199
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
13232
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F")
13237
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F")
13239
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
13251
constantDeclaration(opType, declarations, expr, null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, expr).WithArguments("Library.F") });
13252
constantDeclaration(opType, declarations, $"checked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"checked({expr})").WithArguments("Library.F") });
13253
constantDeclaration(opType, declarations, $"unchecked({expr})", null, new[] { Diagnostic(ErrorCode.
ERR_NotConstantExpression
, $"unchecked({expr})").WithArguments("Library.F") });
13345
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked(uint.MaxValue + (nuint)42)").WithArguments("x").WithLocation(6, 25),
13348
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked(uint.MaxValue + (nuint)42)").WithArguments("y").WithLocation(7, 25),
13410
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "unchecked(-(nint)int.MinValue)").WithArguments("x").WithLocation(6, 24),
13413
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "checked(-(nint)int.MinValue)").WithArguments("y").WithLocation(7, 24),
Semantics\ObjectAndCollectionInitializerTests.cs (1)
2970
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "new int { }").WithArguments("Program.value").WithLocation(4, 33)
Semantics\RecordStructTests.cs (1)
2729
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "X + 1").WithArguments("C.Z").WithLocation(4, 19)
Semantics\SemanticErrorTests.cs (5)
3844
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "c").WithArguments("MyClass.b").WithLocation(4, 25));
3875
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "C.F()").WithArguments("E.Y").WithLocation(4, 9),
3878
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "C.G() + 1").WithArguments("E.Z").WithLocation(5, 9));
3897
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "2 * y").WithArguments("x").WithLocation(6, 23));
17213
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "from x in new int[] { 1, 2, 3 } select x").WithArguments("P.e")
Semantics\StructConstructorTests.cs (6)
3625
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(S0)").WithArguments("Program.d0").WithLocation(14, 23),
3628
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(S1)").WithArguments("Program.d1").WithLocation(15, 23),
3631
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(S2)").WithArguments("Program.d2").WithLocation(16, 23),
3634
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "new S0()").WithArguments("Program.s0").WithLocation(17, 23),
3637
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "new S1()").WithArguments("Program.s1").WithLocation(18, 23),
3640
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "new S2()").WithArguments("Program.s2").WithLocation(19, 23));
Semantics\TargetTypedDefaultTests.cs (9)
1087
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(T)default").WithArguments("z").WithLocation(8, 26)
1117
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(S)default").WithArguments("z").WithLocation(9, 26)
3648
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(int?)").WithArguments("C<T>.x2").WithLocation(6, 21),
3651
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "(default)").WithArguments("C<T>.x3").WithLocation(7, 21),
3654
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default").WithArguments("C<T>.y1").WithLocation(8, 19),
3657
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(S?)").WithArguments("C<T>.y2").WithLocation(9, 19),
3660
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default").WithArguments("C<T>.z1").WithLocation(10, 19),
3663
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default(T?)").WithArguments("C<T>.z2").WithLocation(11, 19),
3666
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "default").WithArguments("C<T>.x1").WithLocation(5, 21)
Semantics\Utf8StringsLiteralsTests.cs (1)
2548
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"""07""U8").WithArguments("C.x").WithLocation(5, 34),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\SymbolErrorTests.cs (2)
15671
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "var1").WithArguments("s._Type3"));
15711
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, @"System.Convert.ToInt32(@""1"")").WithArguments("s._Type4"));
Symbols\UnsignedRightShiftTests.cs (1)
527
Diagnostic(ErrorCode.
ERR_NotConstantExpression
, "x >>> 1").WithArguments("y").WithLocation(9, 24)