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

Fix #8715: enforce syntax for _* (alternate version) #8753

Merged
merged 2 commits into from
Apr 20, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 20, 2020

Previously we didn't check that _* is indeed the last argument,
checking for ")" is not enough, as ")" may be the closing parenthesis
of a nested pattern.

@odersky
Copy link
Contributor Author

odersky commented Apr 20, 2020

This is derived from #8732 and similar to it. The difference is that we use a refined Location type instead of a Parser-global variable. Also, we issue a migration warning already in 3.0 in situations like

x op (b: _*)

Previously we didn't check that _* is indeed the last argument,
checking for ")" is not enough, as ")" may be the closing parenthesis
of a nested pattern.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

LGTM, elegant solution👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants