262 references to ERR_UnexpectedToken
Microsoft.CodeAnalysis.CSharp (16)
Binder\Binder_Deconstruct.cs (2)
935
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, scopedType.ScopedKeyword.GetLocation(), scopedType.ScopedKeyword.ValueText);
941
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, refType.RefKeyword.GetLocation(), refType.RefKeyword.ValueText);
Binder\Binder_Expressions.cs (5)
859
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, firstToken.GetLocation(), firstToken.ValueText);
868
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, firstToken.GetLocation(), firstToken.ValueText);
875
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, firstToken.GetLocation(), firstToken.ValueText);
3260
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, scopedType.ScopedKeyword.GetLocation(), scopedType.ScopedKeyword.ValueText);
3266
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, refType.RefKeyword.GetLocation(), refType.RefKeyword.ValueText);
Binder\Binder_Symbols.cs (2)
501
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, refToken.GetLocation(), refToken.ToString());
515
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, scopedToken.GetLocation(), scopedToken.ToString());
Errors\ErrorFacts.cs (1)
1192
or ErrorCode.
ERR_UnexpectedToken
Parser\LanguageParser.cs (5)
2213
AddTrailingSkippedSyntax(bounds, this.AddError(separatorToken, ErrorCode.
ERR_UnexpectedToken
, SyntaxFacts.GetText(SyntaxKind.CommaToken)));
2285
? this.AddError(this.EatToken(), ErrorCode.
ERR_UnexpectedToken
, SyntaxFacts.GetText(SyntaxKind.QuestionToken))
3541
initializer = this.AddErrorToFirstToken(initializer, ErrorCode.
ERR_UnexpectedToken
, colonToken.Text);
11251
leftOperand.Kind == SyntaxKind.IsPatternExpression ? ErrorCode.
ERR_UnexpectedToken
: ErrorCode.WRN_PrecedenceInversion,
14262
node = this.AddError(node, ErrorCode.
ERR_UnexpectedToken
, trailingTrash[0].ToString());
Symbols\Source\SourceMethodSymbol.cs (1)
39
diagnostics.Add(ErrorCode.
ERR_UnexpectedToken
, refKeyword.GetLocation(), refKeyword.ToString());
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenNullCoalescingAssignmentTests.cs (2)
1281
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 16),
1302
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(10, 20));
CodeGen\CodeGenUsingDeclarationTests.cs (3)
1881
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 15));
1894
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(2, 7));
1904
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(2, 8),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (19)
Semantics\OutVarTests.cs (7)
21209
(int)ErrorCode.
ERR_UnexpectedToken
,
21571
(int)ErrorCode.
ERR_UnexpectedToken
,
21769
(int)ErrorCode.
ERR_UnexpectedToken
,
21970
(int)ErrorCode.
ERR_UnexpectedToken
,
22217
(int)ErrorCode.
ERR_UnexpectedToken
,
22385
(int)ErrorCode.
ERR_UnexpectedToken
,
22551
(int)ErrorCode.
ERR_UnexpectedToken
,
Semantics\PatternMatchingTests.cs (3)
4177
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "A as B < C, D >").WithArguments("E").WithLocation(1, 1)
4184
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "A is B < C").WithArguments(",").WithLocation(1, 1)
6178
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(7, 23),
Semantics\PatternMatchingTests_Scope.cs (7)
12062
(int)ErrorCode.
ERR_UnexpectedToken
,
12400
(int)ErrorCode.
ERR_UnexpectedToken
,
12593
(int)ErrorCode.
ERR_UnexpectedToken
,
12791
(int)ErrorCode.
ERR_UnexpectedToken
,
13026
(int)ErrorCode.
ERR_UnexpectedToken
,
13188
(int)ErrorCode.
ERR_UnexpectedToken
,
13348
(int)ErrorCode.
ERR_UnexpectedToken
,
Semantics\PatternMatchingTests3.cs (2)
547
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 40),
553
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 56));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (64)
Semantics\LambdaTests.cs (4)
5460
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 29),
5466
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 22));
5488
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 29),
5491
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 22));
Semantics\LocalFunctionTests.cs (2)
54
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 11),
60
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(10, 15),
Semantics\NullableReferenceTypesTests.cs (3)
99159
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "?").WithArguments("?").WithLocation(4, 30),
99162
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "?").WithArguments("?").WithLocation(6, 55),
99165
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "?").WithArguments("?").WithLocation(8, 45)
Semantics\RefEscapingTests.cs (1)
9728
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(13, 37));
Semantics\RefFieldTests.cs (46)
12553
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(3, 2),
12559
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(4, 2),
12562
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 9),
12568
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(5, 2),
12571
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(5, 9),
12607
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(12, 2),
12613
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(13, 2),
12616
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(13, 9),
12622
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(14, 2),
12625
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(14, 9)
12963
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(3, 8),
12969
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(4, 8),
12972
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 15),
12978
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(5, 8),
12981
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(5, 15),
13017
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(12, 8),
13023
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(13, 8),
13026
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(13, 15),
13032
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "scoped").WithArguments("scoped").WithLocation(14, 8),
13035
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(14, 15)
20970
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 19),
20973
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 26)
27639
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 22),
27645
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 22)
27653
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 22),
27656
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 22)
27729
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 23),
27735
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 23)
27743
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(8, 23),
27746
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 23)
27807
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(2, 7),
27813
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 7),
27825
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(5, 14),
27834
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 14),
27845
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(2, 7),
27851
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 7),
27857
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(5, 14),
27863
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 14),
27908
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 12),
27914
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 16),
27926
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 31),
27935
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(7, 35),
27946
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 12),
27952
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 16),
27958
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(6, 31),
27964
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(7, 35),
Semantics\RefLocalsAndReturnsTests.cs (7)
5145
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 8),
5148
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 7)
5202
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(7, 21),
5243
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 2),
5246
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 2),
5282
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(2, 7),
5285
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(3, 7),
Semantics\SimpleLambdaParametersWithModifiersTests.cs (1)
1282
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(7, 16),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\Source\MethodTests.cs (2)
2269
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 18),
2293
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(4, 18),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (156)
Parsing\AllowsConstraintParsing.cs (4)
654
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, ",").WithArguments(",").WithLocation(2, 39)
707
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, ",").WithArguments(",").WithLocation(2, 47)
765
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, ",").WithArguments(",").WithLocation(2, 42)
836
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, ",").WithArguments(",").WithLocation(2, 50)
Parsing\CollectionExpressionParsingTests.cs (7)
3738
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "a ? b?[c] : d ? e ? f?[g] : h : i : j : k").WithArguments(":").WithLocation(1, 1));
7043
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "A < B?[] >").WithArguments("D").WithLocation(1, 1));
7197
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "typeof(A < B?[] > ").WithArguments("D").WithLocation(1, 1),
7246
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "default(A < B?[] > ").WithArguments("D").WithLocation(1, 1),
13472
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A][B](C, D) ? ([e] f").WithArguments(")").WithLocation(1, 1),
13658
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A][B](C, D) ? ((e,f) g").WithArguments(")").WithLocation(1, 1),
13864
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A][B](C, D) ? ((e,f)[] g").WithArguments(")").WithLocation(1, 1),
Parsing\DeclarationParsingTests.cs (2)
7117
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "?").WithArguments("?").WithLocation(2, 28)
7209
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "?").WithArguments("?").WithLocation(2, 28)
Parsing\DeclarationScopeParsingTests.cs (11)
1006
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(ref scoped ").WithArguments("int").WithLocation(1, 1),
1040
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(").WithArguments("in").WithLocation(1, 1),
1070
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(").WithArguments("out").WithLocation(1, 1),
1142
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(scoped ").WithArguments("scoped").WithLocation(1, 1),
9748
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (ref scoped int b ").WithArguments("in").WithLocation(2, 1),
10035
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (@scoped int a ").WithArguments("in").WithLocation(2, 1),
10133
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (@scoped ref int b ").WithArguments("in").WithLocation(2, 1),
10707
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (scoped scoped int a ").WithArguments("in").WithLocation(2, 1),
10761
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (scoped scoped var b ").WithArguments("in").WithLocation(2, 1),
10819
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (scoped var (b, c) ").WithArguments("in").WithLocation(2, 1),
11031
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "foreach (scoped ref int[M(out var b)] a ").WithArguments("in").WithLocation(2, 1),
Parsing\ExpressionParsingTests.cs (3)
5847
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "1. ").WithArguments(".2").WithLocation(1, 1),
5873
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "..").WithArguments(".").WithLocation(1, 1));
5888
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "1..").WithArguments(".").WithLocation(1, 1));
Parsing\ForStatementParsingTest.cs (2)
3714
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "for (from a in b select c;").WithArguments("from").WithLocation(1, 1),
4355
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "for (a with { }").WithArguments(";").WithLocation(1, 1),
Parsing\LambdaAttributeParsingTests.cs (10)
278
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A]").WithArguments("ref").WithLocation(1, 1));
302
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A]").WithArguments("in").WithLocation(1, 1));
1188
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "-- [A] ()").WithArguments("=>").WithLocation(1, 1));
1223
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "! [A] ()").WithArguments("=>").WithLocation(1, 1));
1258
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(F) [A] ()").WithArguments("=>").WithLocation(1, 1));
1346
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x * [A] ()").WithArguments("=>").WithLocation(1, 1));
2595
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x as string ? [A]").WithArguments("y").WithLocation(1, 1));
3570
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A]").WithArguments("delegate").WithLocation(1, 1));
3600
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[return: A]").WithArguments("delegate").WithLocation(1, 1),
3633
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "d = [A] ").WithArguments("delegate").WithLocation(1, 1),
Parsing\LambdaParameterParsingTests.cs (12)
645
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int a, int ").WithArguments("b").WithLocation(1, 1),
690
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(__arglist)").WithArguments("=>").WithLocation(1, 1));
711
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int x, __arglist)").WithArguments("=>").WithLocation(1, 1));
2947
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int ").WithArguments("x").WithLocation(1, 1),
3021
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int ").WithArguments("x").WithLocation(1, 1),
3093
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int ").WithArguments("x").WithLocation(1, 1),
3318
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int ").WithArguments("x").WithLocation(1, 1),
4138
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(Func<int, int> ").WithArguments("l1").WithLocation(1, 1),
4677
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(int x = > 0) => x").WithArguments(";").WithLocation(1, 1),
4728
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(__arglist = null)").WithArguments("=>").WithLocation(1, 1));
5296
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "").WithArguments("static").WithLocation(1, 1));
5312
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "f = [A]").WithArguments("int").WithLocation(1, 1));
Parsing\LambdaReturnTypeParsingTests.cs (15)
211
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "T").WithArguments("x").WithLocation(1, 1));
217
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "T").WithArguments("x").WithLocation(1, 1));
237
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "T").WithArguments("F").WithLocation(1, 1));
253
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "async").WithArguments("T").WithLocation(1, 1));
272
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "").WithArguments("static").WithLocation(1, 1));
293
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "delegate ").WithArguments("T").WithLocation(1, 1),
323
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "delegate ").WithArguments("int").WithLocation(1, 1),
701
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "int? () => x").WithArguments(":").WithLocation(1, 1));
776
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "int[]? () => x").WithArguments(":").WithLocation(1, 1));
1580
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "delegate*<void>? () => x").WithArguments(":").WithLocation(1, 1));
1657
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static T? () => x").WithArguments(":").WithLocation(1, 1));
1787
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "async").WithArguments("T").WithLocation(1, 1));
1845
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "[A] T? () => x").WithArguments(":").WithLocation(1, 1));
4668
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x is T ()").WithArguments("=>").WithLocation(1, 1));
5144
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "var").WithArguments("x").WithLocation(1, 1));
Parsing\MemberDeclarationParsingTests.cs (25)
125
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x").WithArguments("=").WithLocation(1, 1)
704
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "public int x;").WithArguments("public").WithLocation(1, 1)
849
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "async Task<SomeNamespace. Method").WithArguments("(").WithLocation(1, 1),
892
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "public Task<SomeNamespace. Method").WithArguments("(").WithLocation(1, 1),
1229
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "required Prop").WithArguments("{").WithLocation(1, 1),
1277
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "required required").WithArguments("{").WithLocation(1, 1),
1296
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "required required Prop").WithArguments("{").WithLocation(1, 1),
1392
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "required Field").WithArguments(";").WithLocation(1, 1),
1437
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "required required").WithArguments(";").WithLocation(1, 1),
6195
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "N.I. ").WithArguments("int").WithLocation(1, 1),
13790
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "partial").WithArguments("void").WithLocation(1, 1),
13864
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "partial").WithArguments("void").WithLocation(1, 1),
15198
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A.GetAllValues").WithArguments("(").WithLocation(1, 1),
15272
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::GetAllValues").WithArguments("(").WithLocation(1, 1),
15346
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::B.GetAllValues").WithArguments("(").WithLocation(1, 1),
15589
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) B.GetAllValues<T").WithArguments("(").WithLocation(1, 1),
15675
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) B.GetAllValues<T>").WithArguments("(").WithLocation(1, 1),
15758
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::B.GetAllValues<T").WithArguments("(").WithLocation(1, 1),
15852
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::B.GetAllValues<T>").WithArguments("(").WithLocation(1, 1),
15943
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::GetAllValues<T").WithArguments("(").WithLocation(1, 1),
16029
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IEnumerable<(string Value, string Description) A::GetAllValues<T>").WithArguments("(").WithLocation(1, 1),
16693
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IDictionary<(string Value, string Description) ").WithArguments("(").WithLocation(1, 1),
16751
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IDictionary<(string Value, string Description) ").WithArguments("(").WithLocation(1, 1),
16809
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IDictionary<(string Value, string Description) ").WithArguments("(").WithLocation(1, 1),
16867
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "static IDictionary<(string Value, string Description) ").WithArguments("(").WithLocation(1, 1),
Parsing\NameParsingTests.cs (3)
79
Assert.Equal((int)ErrorCode.
ERR_UnexpectedToken
, name.Errors()[0].Code);
94
Assert.Equal((int)ErrorCode.
ERR_UnexpectedToken
, name.Errors()[0].Code);
109
Assert.Equal((int)ErrorCode.
ERR_UnexpectedToken
, name.Errors()[0].Code);
Parsing\NullableParsingTests.cs (2)
138
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(object[]??)").WithArguments("null").WithLocation(1, 1),
190
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "(object[?])").WithArguments("null").WithLocation(1, 1),
Parsing\PartialEventsAndConstructorsParsingTests.cs (1)
1091
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "partial").WithArguments("const").WithLocation(1, 1),
Parsing\PatternParsingTests.cs (7)
7800
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "a switch {}").WithArguments(".").WithLocation(1, 1));
7820
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "a switch {}").WithArguments("[").WithLocation(1, 1));
7840
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "a switch {}").WithArguments("(").WithLocation(1, 1));
7860
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "a switch {}").WithArguments("!").WithLocation(1, 1));
8181
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "+").WithArguments("+").WithLocation(1, 10)
8219
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "+").WithArguments("+").WithLocation(1, 9)
11962
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "_ = i is (1, ").WithArguments("}").WithLocation(1, 1),
Parsing\PatternParsingTests_ListPatterns.cs (6)
185
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "c is ()").WithArguments("[").WithLocation(1, 1));
212
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "c is {}").WithArguments("[").WithLocation(1, 1));
808
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "..").WithArguments("..").WithLocation(1, 12));
946
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "..").WithArguments("..").WithLocation(1, 11));
981
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "..").WithArguments("..").WithLocation(1, 16));
1031
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "..").WithArguments("..").WithLocation(1, 14));
Parsing\PatternParsingTests2.cs (2)
1046
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "e is List<int").WithArguments("{").WithLocation(1, 1),
1269
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "e is X<Y").WithArguments("{").WithLocation(1, 1));
Parsing\RangeExpressionParsingTests.cs (2)
263
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x is (int)").WithArguments(".").WithLocation(1, 1));
294
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "x is (int)").WithArguments(".").WithLocation(1, 1));
Parsing\RawInterpolatedStringLiteralCompilingTests.cs (2)
679
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "").WithArguments("#").WithLocation(4, 2),
708
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "").WithArguments("#").WithLocation(4, 2),
Parsing\RecordParsing.cs (2)
1647
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "M() with { }").WithArguments(".").WithLocation(1, 1)
1855
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "with").WithArguments("with").WithLocation(1, 12)
Parsing\RefReadonlyTests.cs (3)
192
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 10),
195
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(9, 28),
198
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "ref").WithArguments("ref").WithLocation(11, 41));
Parsing\StatementParsingTests.cs (3)
33
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "").WithArguments("private").WithLocation(1, 1),
2768
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "await var ").WithArguments("a").WithLocation(1, 1),
4119
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "_ = new (int, int) ? (x) ").WithArguments(":").WithLocation(1, 1),
Parsing\Utf8StringLiteralsParsingTests.cs (32)
250
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""").WithArguments("u8").WithLocation(1, 1)
266
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""").WithArguments("u").WithLocation(1, 1)
282
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""").WithArguments("8").WithLocation(1, 1)
299
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""u8").WithArguments("0").WithLocation(1, 1)
315
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "1L").WithArguments("0").WithLocation(1, 1)
331
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, "1").WithArguments("L").WithLocation(1, 1)
348
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""").WithArguments("u8").WithLocation(1, 1)
364
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""").WithArguments("u").WithLocation(1, 1)
380
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""").WithArguments("8").WithLocation(1, 1)
397
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""u8").WithArguments("0").WithLocation(1, 1)
414
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""").WithArguments("U8").WithLocation(1, 1)
430
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""").WithArguments("U").WithLocation(1, 1)
447
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"@""hello""U8").WithArguments("0").WithLocation(1, 1)
464
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""").WithArguments("U8").WithLocation(1, 1)
480
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""").WithArguments("U").WithLocation(1, 1)
497
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""hello""U8").WithArguments("0").WithLocation(1, 1)
513
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$""hello""").WithArguments("u8").WithLocation(1, 1)
534
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$@""hello""").WithArguments("u8").WithLocation(1, 1)
555
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$""hello""").WithArguments("U8").WithLocation(1, 1)
576
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$@""hello""").WithArguments("U8").WithLocation(1, 1)
636
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""hello""""""").WithArguments(suffix).WithLocation(1, 1)
654
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""hello""""""").WithArguments(suffix).WithLocation(1, 1)
670
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""hello""""""").WithArguments("8").WithLocation(1, 1)
689
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""hello""""""" + suffix.Substring(0, 2)).WithArguments("0").WithLocation(1, 1)
707
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$""""""hello""""""").WithArguments(suffix).WithLocation(1, 1)
730
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$@""""""hello""""""").WithArguments(suffix).WithLocation(1, 1)
800
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""
824
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""
846
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""
871
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"""""""
895
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$""""""
922
Diagnostic(ErrorCode.
ERR_UnexpectedToken
, @"$@""""""