Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More permissive parsing of instantiation expressions #48659

Merged
merged 2 commits into from
Apr 13, 2022
Merged

Conversation

ahejlsberg
Copy link
Member

Fixes #48654.

// Treat anything else as an expression.
return false;
// Consider something a type argument list only if the following token can't start an expression.
return !isStartOfExpression();
Copy link
Member

Choose a reason for hiding this comment

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

I'm always surprised that this function exists and doesn't fall out of date in some catastrophic way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, we'd know right away. For example, in when parsing argument lists or array literal elements, we require it to return true before each element (it's called from isListElement which is called from parseList).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASI not working after arguments-less new expression with type arguments
3 participants