107 references to ERR_ConstantExpected
Microsoft.CodeAnalysis.CSharp (8)
Binder\Binder_Expressions.cs (2)
3738Error(diagnostics, ErrorCode.ERR_ConstantExpected, size.Syntax); 3975Error(diagnostics, ErrorCode.ERR_ConstantExpected, sizeOpt.Syntax);
Binder\Binder_InterpolatedString.cs (1)
117diagnostics.Add(ErrorCode.ERR_ConstantExpected, interpolation.AlignmentClause.Value.Location);
Binder\Binder_Patterns.cs (1)
560diagnostics.Add(ErrorCode.ERR_ConstantExpected, patternExpression.Location);
Binder\SwitchBinder.cs (1)
503diagnostics.Add(ErrorCode.ERR_ConstantExpected, node.Location);
Errors\ErrorFacts.cs (1)
675case ErrorCode.ERR_ConstantExpected:
Parser\LanguageParser.cs (2)
5306? this.ParseIdentifierName(ErrorCode.ERR_ConstantExpected) 9159ParseIdentifierName(ErrorCode.ERR_ConstantExpected),
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\SwitchTests.cs (1)
2628Diagnostic(ErrorCode.ERR_ConstantExpected, "i").WithLocation(8, 18)
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (36)
Diagnostics\OperationAnalyzerTests.cs (2)
281Diagnostic(ErrorCode.ERR_ConstantExpected, ":").WithLocation(44, 18)) 1078Diagnostic(ErrorCode.ERR_ConstantExpected, ":").WithLocation(41, 18))
Semantics\PatternMatchingTests.cs (18)
3226Diagnostic(ErrorCode.ERR_ConstantExpected, "typeof(string)").WithLocation(9, 18), 3229Diagnostic(ErrorCode.ERR_ConstantExpected, "typeof(string[])").WithLocation(12, 18) 4386Diagnostic(ErrorCode.ERR_ConstantExpected, "_").WithLocation(12, 18) 4668Diagnostic(ErrorCode.ERR_ConstantExpected, "M").WithLocation(10, 18), 4671Diagnostic(ErrorCode.ERR_ConstantExpected, "(int)M()").WithLocation(11, 19) 4698Diagnostic(ErrorCode.ERR_ConstantExpected, "M").WithLocation(8, 18) 4721Diagnostic(ErrorCode.ERR_ConstantExpected, "M").WithLocation(6, 21) 4820Diagnostic(ErrorCode.ERR_ConstantExpected, "true ? x3 : 4").WithLocation(9, 18), 8694Diagnostic(ErrorCode.ERR_ConstantExpected, "null").WithLocation(5, 58), 8767Diagnostic(ErrorCode.ERR_ConstantExpected, "null").WithLocation(5, 63)); 10294Diagnostic(ErrorCode.ERR_ConstantExpected, "null").WithLocation(5, 50), 10367Diagnostic(ErrorCode.ERR_ConstantExpected, "null").WithLocation(5, 55)); 10703Diagnostic(ErrorCode.ERR_ConstantExpected, @"$""{123}""").WithLocation(5, 56), 10706Diagnostic(ErrorCode.ERR_ConstantExpected, @"$""{n}""").WithLocation(6, 48)); 10752Diagnostic(ErrorCode.ERR_ConstantExpected, @"b ? """" : ""ABC""").WithLocation(4, 65), 10755Diagnostic(ErrorCode.ERR_ConstantExpected, @"b ? """" : ""123""").WithLocation(5, 57)); 10800Diagnostic(ErrorCode.ERR_ConstantExpected, @"b switch { true => """", false => ""ABC"" }").WithLocation(4, 64), 10803Diagnostic(ErrorCode.ERR_ConstantExpected, @"b switch { false => """", true => ""123"" }").WithLocation(5, 56));
Semantics\PatternMatchingTests_Scope.cs (1)
5199Diagnostic(ErrorCode.ERR_ConstantExpected, "y10").WithLocation(89, 18),
Semantics\PatternMatchingTests3.cs (2)
1865Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case (string str, decimal[] arr);").WithLocation(9, 17), 5878Diagnostic(ErrorCode.ERR_ConstantExpected, "a").WithLocation(5, 18),
Semantics\PatternMatchingTests4.cs (11)
60Diagnostic(ErrorCode.ERR_ConstantExpected, "default(T)").WithLocation(8, 18)); 100Diagnostic(ErrorCode.ERR_ConstantExpected, "M2").WithLocation(15, 18), 103Diagnostic(ErrorCode.ERR_ConstantExpected, "M2").WithLocation(18, 18)); 112Diagnostic(ErrorCode.ERR_ConstantExpected, "M1").WithLocation(6, 18), 118Diagnostic(ErrorCode.ERR_ConstantExpected, "M1").WithLocation(9, 18), 121Diagnostic(ErrorCode.ERR_ConstantExpected, "M2").WithLocation(15, 18), 124Diagnostic(ErrorCode.ERR_ConstantExpected, "M2").WithLocation(18, 18)); 162Diagnostic(ErrorCode.ERR_ConstantExpected, "stackalloc int[1] { 0 }").WithLocation(10, 18), 165Diagnostic(ErrorCode.ERR_ConstantExpected, "new { X = 0 }").WithLocation(12, 18) 3273Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case string.Empty.Length;").WithLocation(10, 21) 3441Diagnostic(ErrorCode.ERR_ConstantExpected, "1").WithLocation(6, 18),
Semantics\PatternMatchingTests5.cs (1)
1073Diagnostic(ErrorCode.ERR_ConstantExpected, "s->X").WithLocation(6, 18)
Semantics\PatternSwitchTests.cs (1)
1888Diagnostic(ErrorCode.ERR_ConstantExpected, "new object() is int x1").WithLocation(8, 18),
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (24)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (8)
291Diagnostic(ErrorCode.ERR_ConstantExpected, "dimension").WithLocation(6, 38) 1321Diagnostic(ErrorCode.ERR_ConstantExpected, "d1 ?? d2").WithLocation(8, 22) 1542Diagnostic(ErrorCode.ERR_ConstantExpected, "d1 ?? d2").WithLocation(8, 25) 1693Diagnostic(ErrorCode.ERR_ConstantExpected, "d1 ?? d2").WithLocation(7, 22), 1696Diagnostic(ErrorCode.ERR_ConstantExpected, "d3 ?? d4").WithLocation(7, 32) 2803Diagnostic(ErrorCode.ERR_ConstantExpected, "d1 ?? d2").WithLocation(7, 22) 3041Diagnostic(ErrorCode.ERR_ConstantExpected, "d1 ?? d2").WithLocation(7, 22), 3044Diagnostic(ErrorCode.ERR_ConstantExpected, "d3 ?? d4").WithLocation(7, 32)
IOperation\IOperationTests_IInterpolatedStringOperation.cs (1)
1347Diagnostic(ErrorCode.ERR_ConstantExpected, "(a ? b : c)").WithLocation(8, 18)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
344Diagnostic(ErrorCode.ERR_ConstantExpected, "y").WithLocation(8, 28)
IOperation\IOperationTests_IPatternSwitchCase.cs (2)
425Diagnostic(ErrorCode.ERR_ConstantExpected, "x is true").WithLocation(9, 28) 487Diagnostic(ErrorCode.ERR_ConstantExpected, "typeof(X)").WithLocation(9, 28)
IOperation\IOperationTests_ISwitchExpression.cs (1)
1410Diagnostic(ErrorCode.ERR_ConstantExpected, "a ? input1 : input2").WithLocation(9, 18)
IOperation\IOperationTests_ISwitchOperation.cs (10)
1311Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 18) 1474Diagnostic(ErrorCode.ERR_ConstantExpected, "1").WithLocation(8, 18) 1818Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 18) 1892Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 18) 2081Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 18) 2256Diagnostic(ErrorCode.ERR_ConstantExpected, "input1 ?? input2").WithLocation(8, 18) 2533Diagnostic(ErrorCode.ERR_ConstantExpected, "other ?? 1").WithLocation(8, 18) 3128Diagnostic(ErrorCode.ERR_ConstantExpected, "1+TakeOutParam(3, out MyClass x1)").WithLocation(8, 18) 3225Diagnostic(ErrorCode.ERR_ConstantExpected, "1+(input is int x1 ? x1 : 0)").WithLocation(8, 18) 3484Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 20)
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (1)
291Diagnostic(ErrorCode.ERR_ConstantExpected, "dimension").WithLocation(6, 42)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (35)
Semantics\ConstantTests.cs (2)
3408Diagnostic(ErrorCode.ERR_ConstantExpected, @"(string)(object)""b""").WithLocation(19, 18), 3417Diagnostic(ErrorCode.ERR_ConstantExpected, @"(object)""b""").WithLocation(23, 18),
Semantics\ImplicitObjectCreationTests.cs (6)
2624Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(8, 18), 2627Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(9, 19) 3722Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(10, 27) 4851Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(6, 18), 4857Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(12, 18), 4860Diagnostic(ErrorCode.ERR_ConstantExpected, "new T()").WithLocation(13, 18)
Semantics\InterpolationTests.cs (3)
654Diagnostic(ErrorCode.ERR_ConstantExpected, "1E10").WithLocation(5, 22), 660Diagnostic(ErrorCode.ERR_ConstantExpected, "(int)1E10").WithLocation(6, 22) 1560Diagnostic(ErrorCode.ERR_ConstantExpected, "a").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
77488Diagnostic(ErrorCode.ERR_ConstantExpected, "F").WithLocation(6, 18), 115795Diagnostic(ErrorCode.ERR_ConstantExpected, "default(T)").WithLocation(6, 19),
Semantics\NullableReferenceTypesVsPatterns.cs (1)
179Diagnostic(ErrorCode.ERR_ConstantExpected, "nonConstant").WithLocation(7, 18),
Semantics\OutVarTests.cs (3)
32604Diagnostic(ErrorCode.ERR_ConstantExpected, "!TakeOutParam(3, out var x1)").WithLocation(8, 18) 34925Diagnostic(ErrorCode.ERR_ConstantExpected, "!M(nameof(M(out int z1)), z1)").WithLocation(8, 18), 34931Diagnostic(ErrorCode.ERR_ConstantExpected, "!M(nameof(M(out var z2)), z2)").WithLocation(11, 18),
Semantics\PrimaryConstructorTests.cs (4)
8470Diagnostic(ErrorCode.ERR_ConstantExpected, "p1").WithLocation(6, 21), 8473Diagnostic(ErrorCode.ERR_ConstantExpected, "p2.F").WithLocation(6, 32) 8515Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case p1;").WithLocation(11, 17) 10506Diagnostic(ErrorCode.ERR_ConstantExpected, "Color.Red").WithLocation(10, 22)
Semantics\RawInterpolationTests.cs (3)
669Diagnostic(ErrorCode.ERR_ConstantExpected, "1E10").WithLocation(5, 24), 675Diagnostic(ErrorCode.ERR_ConstantExpected, "(int)1E10").WithLocation(6, 24)); 1231Diagnostic(ErrorCode.ERR_ConstantExpected, "a").WithLocation(4, 23));
Semantics\SemanticAnalyzerTests.cs (1)
1294Diagnostic(ErrorCode.ERR_ConstantExpected, "x").WithLocation(14, 35),
Semantics\SemanticErrorTests.cs (2)
4265Diagnostic(ErrorCode.ERR_ConstantExpected, "x")); 9015Diagnostic(ErrorCode.ERR_ConstantExpected, "-1L").WithLocation(10, 35));
Semantics\StackAllocInitializerTests.cs (3)
760Diagnostic(ErrorCode.ERR_ConstantExpected, "await Task.FromResult(1)").WithLocation(8, 38), 2534Diagnostic(ErrorCode.ERR_ConstantExpected, "*obj1").WithLocation(7, 41), 2537Diagnostic(ErrorCode.ERR_ConstantExpected, "obj2.Length").WithLocation(8, 46),
Semantics\SwitchTests.cs (4)
153Diagnostic(ErrorCode.ERR_ConstantExpected, "test").WithLocation(11, 18) 158Diagnostic(ErrorCode.ERR_ConstantExpected, "test").WithLocation(11, 18) 1043Diagnostic(ErrorCode.ERR_ConstantExpected, "1+(o.GetType().Name.Length)").WithLocation(8, 19), 1054Diagnostic(ErrorCode.ERR_ConstantExpected, "1+(o.GetType().Name.Length)").WithLocation(8, 19),
Semantics\Utf8StringsLiteralsTests.cs (1)
2949Diagnostic(ErrorCode.ERR_ConstantExpected, @"""2""u8").WithLocation(8, 18)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\ConversionTests.cs (2)
1135Diagnostic(ErrorCode.ERR_ConstantExpected, "default(Convertible)").WithLocation(8, 18) 1165Diagnostic(ErrorCode.ERR_ConstantExpected, "c").WithLocation(9, 18)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParserErrorMessageTests.cs (1)
244Diagnostic(ErrorCode.ERR_ConstantExpected, "}").WithLocation(4, 42),