65 references to ERR_ConstantExpected
Microsoft.CodeAnalysis.CSharp (8)
Binder\Binder_Expressions.cs (2)
4448Error(diagnostics, ErrorCode.ERR_ConstantExpected, size.Syntax); 4685Error(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)
569diagnostics.Add(ErrorCode.ERR_ConstantExpected, patternExpression.Location);
Binder\SwitchBinder.cs (1)
507diagnostics.Add(ErrorCode.ERR_ConstantExpected, node.Location);
Errors\ErrorFacts.cs (1)
736or ErrorCode.ERR_ConstantExpected
Parser\LanguageParser.cs (2)
5727? this.ParseIdentifierName(ErrorCode.ERR_ConstantExpected) 9909ParseIdentifierName(ErrorCode.ERR_ConstantExpected),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (24)
Diagnostics\OperationAnalyzerTests.cs (2)
281Diagnostic(ErrorCode.ERR_ConstantExpected, ":").WithLocation(44, 18)) 1078Diagnostic(ErrorCode.ERR_ConstantExpected, ":").WithLocation(41, 18))
FieldKeywordTests.cs (1)
10329Diagnostic(ErrorCode.ERR_ConstantExpected, "field").WithLocation(6, 50));
Semantics\OutVarTests.cs (2)
34984Diagnostic(ErrorCode.ERR_ConstantExpected, "!M(nameof(M(out int z1)), z1)").WithLocation(8, 18), 34990Diagnostic(ErrorCode.ERR_ConstantExpected, "!M(nameof(M(out var z2)), z2)").WithLocation(11, 18),
Semantics\PatternMatchingTests.cs (4)
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)
Semantics\PatternMatchingTests_Scope.cs (1)
5199Diagnostic(ErrorCode.ERR_ConstantExpected, "y10").WithLocation(89, 18),
Semantics\PatternMatchingTests3.cs (1)
1865Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case (string str, decimal[] arr);").WithLocation(9, 17),
Semantics\PatternMatchingTests4.cs (10)
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)); 161Diagnostic(ErrorCode.ERR_ConstantExpected, "stackalloc int[1] { 0 }").WithLocation(10, 18), 164Diagnostic(ErrorCode.ERR_ConstantExpected, "new { X = 0 }").WithLocation(12, 18) 3272Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case string.Empty.Length;").WithLocation(10, 21)
Semantics\PatternMatchingTests5.cs (1)
3356Diagnostic(ErrorCode.ERR_ConstantExpected, expression).WithLocation(6, 22)
Semantics\PrimaryConstructorTests.cs (2)
9526Diagnostic(ErrorCode.ERR_ConstantExpected, "goto case p1;").WithLocation(11, 17) 11520Diagnostic(ErrorCode.ERR_ConstantExpected, "Color.Red").WithLocation(10, 22)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (12)
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_ISwitchOperation.cs (2)
2081Diagnostic(ErrorCode.ERR_ConstantExpected, "other").WithLocation(8, 18) 2533Diagnostic(ErrorCode.ERR_ConstantExpected, "other ?? 1").WithLocation(8, 18)
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (1)
291Diagnostic(ErrorCode.ERR_ConstantExpected, "dimension").WithLocation(6, 42)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\ImplicitObjectCreationTests.cs (3)
4992Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(6, 18), 4998Diagnostic(ErrorCode.ERR_ConstantExpected, "new()").WithLocation(12, 18), 5001Diagnostic(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) 1558Diagnostic(ErrorCode.ERR_ConstantExpected, "a").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
81180Diagnostic(ErrorCode.ERR_ConstantExpected, "F").WithLocation(6, 18)); 119565Diagnostic(ErrorCode.ERR_ConstantExpected, "default(T)").WithLocation(6, 19),
Semantics\NullableReferenceTypesVsPatterns.cs (1)
179Diagnostic(ErrorCode.ERR_ConstantExpected, "nonConstant").WithLocation(7, 18)
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)
4263Diagnostic(ErrorCode.ERR_ConstantExpected, "x")); 9019Diagnostic(ErrorCode.ERR_ConstantExpected, "-1L").WithLocation(10, 35));
Semantics\StackAllocInitializerTests.cs (3)
760Diagnostic(ErrorCode.ERR_ConstantExpected, "await Task.FromResult(1)").WithLocation(8, 38) 2550Diagnostic(ErrorCode.ERR_ConstantExpected, "*obj1").WithLocation(7, 41), 2553Diagnostic(ErrorCode.ERR_ConstantExpected, "obj2.Length").WithLocation(8, 46),
Semantics\SwitchTests.cs (2)
1043Diagnostic(ErrorCode.ERR_ConstantExpected, "1+(o.GetType().Name.Length)").WithLocation(8, 19), 1054Diagnostic(ErrorCode.ERR_ConstantExpected, "1+(o.GetType().Name.Length)").WithLocation(8, 19),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParserErrorMessageTests.cs (1)
244Diagnostic(ErrorCode.ERR_ConstantExpected, "}").WithLocation(4, 42),