65 references to ERR_ConstantExpected
Microsoft.CodeAnalysis.CSharp (8)
Binder\Binder_Expressions.cs (2)
4448
Error(diagnostics, ErrorCode.
ERR_ConstantExpected
, size.Syntax);
4685
Error(diagnostics, ErrorCode.
ERR_ConstantExpected
, sizeOpt.Syntax);
Binder\Binder_InterpolatedString.cs (1)
117
diagnostics.Add(ErrorCode.
ERR_ConstantExpected
, interpolation.AlignmentClause.Value.Location);
Binder\Binder_Patterns.cs (1)
569
diagnostics.Add(ErrorCode.
ERR_ConstantExpected
, patternExpression.Location);
Binder\SwitchBinder.cs (1)
507
diagnostics.Add(ErrorCode.
ERR_ConstantExpected
, node.Location);
Errors\ErrorFacts.cs (1)
736
or ErrorCode.
ERR_ConstantExpected
Parser\LanguageParser.cs (2)
5727
? this.ParseIdentifierName(ErrorCode.
ERR_ConstantExpected
)
9909
ParseIdentifierName(ErrorCode.
ERR_ConstantExpected
),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (24)
Diagnostics\OperationAnalyzerTests.cs (2)
281
Diagnostic(ErrorCode.
ERR_ConstantExpected
, ":").WithLocation(44, 18))
1078
Diagnostic(ErrorCode.
ERR_ConstantExpected
, ":").WithLocation(41, 18))
FieldKeywordTests.cs (1)
10329
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "field").WithLocation(6, 50));
Semantics\OutVarTests.cs (2)
34984
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "!M(nameof(M(out int z1)), z1)").WithLocation(8, 18),
34990
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "!M(nameof(M(out var z2)), z2)").WithLocation(11, 18),
Semantics\PatternMatchingTests.cs (4)
4668
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M").WithLocation(10, 18),
4671
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "(int)M()").WithLocation(11, 19)
4698
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M").WithLocation(8, 18)
4721
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M").WithLocation(6, 21)
Semantics\PatternMatchingTests_Scope.cs (1)
5199
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "y10").WithLocation(89, 18),
Semantics\PatternMatchingTests3.cs (1)
1865
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "goto case (string str, decimal[] arr);").WithLocation(9, 17),
Semantics\PatternMatchingTests4.cs (10)
60
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "default(T)").WithLocation(8, 18));
100
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M2").WithLocation(15, 18),
103
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M2").WithLocation(18, 18));
112
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M1").WithLocation(6, 18),
118
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M1").WithLocation(9, 18),
121
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M2").WithLocation(15, 18),
124
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "M2").WithLocation(18, 18));
161
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "stackalloc int[1] { 0 }").WithLocation(10, 18),
164
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "new { X = 0 }").WithLocation(12, 18)
3272
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "goto case string.Empty.Length;").WithLocation(10, 21)
Semantics\PatternMatchingTests5.cs (1)
3356
Diagnostic(ErrorCode.
ERR_ConstantExpected
, expression).WithLocation(6, 22)
Semantics\PrimaryConstructorTests.cs (2)
9526
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "goto case p1;").WithLocation(11, 17)
11520
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "Color.Red").WithLocation(10, 22)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (12)
IOperation\IOperationTests_ArrayCreationAndInitializer.cs (8)
291
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "dimension").WithLocation(6, 38)
1321
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d1 ?? d2").WithLocation(8, 22)
1542
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d1 ?? d2").WithLocation(8, 25)
1693
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d1 ?? d2").WithLocation(7, 22),
1696
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d3 ?? d4").WithLocation(7, 32)
2803
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d1 ?? d2").WithLocation(7, 22)
3041
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d1 ?? d2").WithLocation(7, 22),
3044
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "d3 ?? d4").WithLocation(7, 32)
IOperation\IOperationTests_IInterpolatedStringOperation.cs (1)
1347
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "(a ? b : c)").WithLocation(8, 18)
IOperation\IOperationTests_ISwitchOperation.cs (2)
2081
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "other").WithLocation(8, 18)
2533
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "other ?? 1").WithLocation(8, 18)
IOperation\IOperationTests_StackAllocArrayCreationAndInitializer.cs (1)
291
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "dimension").WithLocation(6, 42)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (20)
Semantics\ImplicitObjectCreationTests.cs (3)
4992
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "new()").WithLocation(6, 18),
4998
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "new()").WithLocation(12, 18),
5001
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "new T()").WithLocation(13, 18)
Semantics\InterpolationTests.cs (3)
654
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "1E10").WithLocation(5, 22),
660
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "(int)1E10").WithLocation(6, 22)
1558
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "a").WithLocation(4, 21)
Semantics\NullableReferenceTypesTests.cs (2)
81180
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "F").WithLocation(6, 18));
119565
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "default(T)").WithLocation(6, 19),
Semantics\NullableReferenceTypesVsPatterns.cs (1)
179
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "nonConstant").WithLocation(7, 18)
Semantics\RawInterpolationTests.cs (3)
669
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "1E10").WithLocation(5, 24),
675
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "(int)1E10").WithLocation(6, 24));
1231
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "a").WithLocation(4, 23));
Semantics\SemanticAnalyzerTests.cs (1)
1294
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "x").WithLocation(14, 35),
Semantics\SemanticErrorTests.cs (2)
4263
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "x"));
9019
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "-1L").WithLocation(10, 35));
Semantics\StackAllocInitializerTests.cs (3)
760
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "await Task.FromResult(1)").WithLocation(8, 38)
2550
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "*obj1").WithLocation(7, 41),
2553
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "obj2.Length").WithLocation(8, 46),
Semantics\SwitchTests.cs (2)
1043
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "1+(o.GetType().Name.Length)").WithLocation(8, 19),
1054
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "1+(o.GetType().Name.Length)").WithLocation(8, 19),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParserErrorMessageTests.cs (1)
244
Diagnostic(ErrorCode.
ERR_ConstantExpected
, "}").WithLocation(4, 42),