The following should probably parse as two scoped modifiers.
We should also consider aligning the parser's behavior on scoped.nested a; (parsed as nested type) versus ref scoped.nested b; (error).
This issue is referenced in a couple of tests.
Relates to test plan #59194
[Theory]
[InlineData(LanguageVersion.CSharp10)]
[InlineData(LanguageVersion.CSharp11)]
public void Local_07_WithInitializer(LanguageVersion langVersion)
{
string source =
@"scoped scoped a = default;
";
UsingTree(source, TestOptions.Regular.WithLanguageVersion(langVersion));
N(SyntaxKind.CompilationUnit);
{
N(SyntaxKind.GlobalStatement);
{
N(SyntaxKind.LocalDeclarationStatement);
{
N(SyntaxKind.ScopedKeyword);
N(SyntaxKind.VariableDeclaration);
{
N(SyntaxKind.IdentifierName);
{
N(SyntaxKind.IdentifierToken, "scoped");
}
N(SyntaxKind.VariableDeclarator);
{
N(SyntaxKind.IdentifierToken, "a");
N(SyntaxKind.EqualsValueClause);
{
N(SyntaxKind.EqualsToken);
N(SyntaxKind.DefaultLiteralExpression);
{
N(SyntaxKind.DefaultKeyword);
}
}
}
}
N(SyntaxKind.SemicolonToken);
}
}
N(SyntaxKind.EndOfFileToken);
}
EOF();
}
The following should probably parse as two
scopedmodifiers.We should also consider aligning the parser's behavior on
scoped.nested a;(parsed as nested type) versusref scoped.nested b;(error).This issue is referenced in a couple of tests.
Relates to test plan #59194