Skip to content

Fix #3460: Fix semicolon insertion confusion after enum case #3730

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

Merged
merged 3 commits into from
Jan 3, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jan 2, 2018

After seeing an enum case, the Scanner thought it is in a pattern, and
therefore does not do semicolon insertion on newlines. We now get it
out of that mode by pretending to be passed the =>.

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@@ -2060,6 +2060,7 @@ object Parsers {
typeDefOrDcl(start, posMods(start, mods))
case CASE =>
enumCase(start, mods)
.reporting(t => i"case $t, current = ${in.show} / ${in.sepRegions}%, %")
Copy link
Member

Choose a reason for hiding this comment

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

Stray debug statement.

@allanrenucci
Copy link
Contributor

Also fixes #2906

odersky and others added 3 commits January 3, 2018 18:03
After seeing an enum case, the Scanner thought it is in a pattern, and
therefore does not do semicolon insertion on newlines. We now get it
out of that mode by pretending to be passed the `=>`.
@smarter smarter merged commit 710fe34 into scala:master Jan 3, 2018
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.

3 participants