48 references to ERR_ConstantValueOfTypeExpected
Microsoft.CodeAnalysis.CSharp (2)
Binder\Binder_Patterns.cs (1)
565diagnostics.Add(ErrorCode.ERR_ConstantValueOfTypeExpected, patternExpression.Location, strippedInputType);
Errors\ErrorFacts.cs (1)
2379or ErrorCode.ERR_ConstantValueOfTypeExpected
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\SwitchTests.cs (1)
2628Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "i").WithArguments("int").WithLocation(8, 18)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (23)
Semantics\OutVarTests.cs (1)
32663Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "!TakeOutParam(3, out var x1)").WithArguments("bool").WithLocation(8, 18)
Semantics\PatternMatchingTests.cs (16)
3226Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "typeof(string)").WithArguments("System.Type").WithLocation(9, 18), 3229Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "typeof(string[])").WithArguments("System.Type").WithLocation(12, 18) 4386Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "_").WithArguments("int").WithLocation(12, 18) 4822Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "true ? x3 : 4").WithArguments("int").WithLocation(9, 18), 8696Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "null").WithArguments("System.ReadOnlySpan<char>").WithLocation(5, 58), 8769Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "null").WithArguments("System.ReadOnlySpan<char>").WithLocation(5, 63) 10297Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "null").WithArguments("System.Span<char>").WithLocation(5, 50), 10370Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "null").WithArguments("System.Span<char>").WithLocation(5, 55) 10707Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"$""{123}""").WithArguments("System.ReadOnlySpan<char>").WithLocation(5, 56), 10710Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"$""{n}""").WithArguments("System.Span<char>").WithLocation(6, 48)); 10756Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"b ? """" : ""ABC""").WithArguments("System.ReadOnlySpan<char>").WithLocation(4, 65), 10759Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"b ? """" : ""123""").WithArguments("System.Span<char>").WithLocation(5, 57)); 10804Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"b switch { true => """", false => ""ABC"" }").WithArguments("System.ReadOnlySpan<char>").WithLocation(4, 64), 10807Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"b switch { false => """", true => ""123"" }").WithArguments("System.Span<char>").WithLocation(5, 56)); 12303Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"""implicitA""").WithArguments("A").WithLocation(8, 38) 12325Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"(A)""castedA""").WithArguments("A").WithLocation(8, 38)
Semantics\PatternMatchingTests3.cs (1)
5878Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "a").WithArguments("int").WithLocation(5, 18),
Semantics\PatternMatchingTests4.cs (1)
3440Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "1").WithArguments("int*").WithLocation(6, 18),
Semantics\PatternMatchingTests5.cs (1)
1073Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "s->X").WithArguments("int").WithLocation(6, 18)
Semantics\PatternSwitchTests.cs (1)
1890Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "new object() is int x1").WithArguments("bool").WithLocation(8, 18),
Semantics\PrimaryConstructorTests.cs (2)
9481Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "p1").WithArguments("int").WithLocation(6, 21), 9484Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "p2.F").WithArguments("int").WithLocation(6, 32)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (12)
IOperation\IOperationTests_IIsPatternExpression.cs (1)
344Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "y").WithArguments("int").WithLocation(8, 28)
IOperation\IOperationTests_IPatternSwitchCase.cs (2)
425Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "x is true").WithArguments("bool").WithLocation(9, 28) 487Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "typeof(X)").WithArguments("System.Type").WithLocation(9, 28)
IOperation\IOperationTests_ISwitchExpression.cs (1)
1410Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "a ? input1 : input2").WithArguments("int").WithLocation(9, 18)
IOperation\IOperationTests_ISwitchOperation.cs (8)
1311Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "other").WithArguments("MyClass").WithLocation(8, 18) 1474Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "1").WithArguments("MyClass").WithLocation(8, 18) 1818Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "other").WithArguments("int").WithLocation(8, 18) 1892Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "other").WithArguments("int").WithLocation(8, 18) 2256Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "input1 ?? input2").WithArguments("int").WithLocation(8, 18) 3128Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "1+TakeOutParam(3, out MyClass x1)").WithArguments("int").WithLocation(8, 18) 3225Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "1+(input is int x1 ? x1 : 0)").WithArguments("int").WithLocation(8, 18) 3484Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "other").WithArguments("int").WithLocation(8, 20)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\ConstantTests.cs (2)
3427Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"(string)(object)""b""").WithArguments("string").WithLocation(19, 18), 3436Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"(object)""b""").WithArguments("string").WithLocation(23, 18),
Semantics\ImplicitObjectCreationTests.cs (3)
2624Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "new()").WithArguments("C").WithLocation(8, 18), 2627Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "new()").WithArguments("C").WithLocation(9, 19) 3722Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "new()").WithArguments("C").WithLocation(10, 27)
Semantics\SwitchTests.cs (2)
153Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "test").WithArguments("int").WithLocation(11, 18) 158Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "test").WithArguments("int").WithLocation(11, 18)
Semantics\Utf8StringsLiteralsTests.cs (1)
2950Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, @"""2""u8").WithArguments("System.ReadOnlySpan<byte>").WithLocation(8, 18)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\ConversionTests.cs (2)
1478Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "default(Convertible)").WithArguments("int").WithLocation(8, 18) 1508Diagnostic(ErrorCode.ERR_ConstantValueOfTypeExpected, "c").WithArguments("int").WithLocation(9, 18)