Skip to content

Conversation

@AlekseyTs
Copy link
Contributor

Related to #41704.

@AlekseyTs AlekseyTs requested a review from a team as a code owner March 13, 2020 15:34
@AlekseyTs
Copy link
Contributor Author

@cston, @RikkiGibson, @dotnet/roslyn-compiler Please review

private bool IsPossibleFirstTypedIdentifierInLocaDeclarationStatement(bool isGlobalScriptLevel)
{

bool? typedIdentifier = IsPossibleTypedIdentifierStart(this.CurrentToken, this.PeekToken(1), allowThisKeyword: false);
Copy link
Contributor

@cston cston Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line. #Resolved

N(SyntaxKind.EndOfFileToken);
}
EOF();
}
Copy link
Contributor

@cston cston Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} [](start = 8, length = 1)

Consider testing using static type = identifier;. #Resolved

@AlekseyTs
Copy link
Contributor Author

@RikkiGibson, @dotnet/roslyn-compiler Please review, need a second sign-off for a fairly small change.


if (IsDeclarationModifier(tk)) // treat `const int x = 2;` as a local variable declaration
{
if (tk != SyntaxKind.StaticKeyword) // For `static` we still need to make sure we have a typed dentifier after it, because `using static type;` is a valid using directive.
Copy link
Member

@RikkiGibson RikkiGibson Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typed *identifier #Resolved

}
}
else if ((SyntaxFacts.IsPredefinedType(tk) &&
this.PeekToken(1).Kind != SyntaxKind.DotToken && // e.g. `int.Parse()` is an expression
Copy link
Member

@RikkiGibson RikkiGibson Mar 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this use 'tk' instead? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this use 'tk' instead?

Good catch, that should peek at the next token instead, i.e. 2.


In reply to: 392430189 [](ancestors = 392430189)

@AlekseyTs AlekseyTs merged commit 1efabcd into dotnet:features/SimplePrograms Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants