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 crash with newline-after-import related to the use of switch cases (fixes #386) #395

Merged
merged 1 commit into from
Jun 23, 2016

Conversation

jfmengels
Copy link
Collaborator

@jfmengels jfmengels commented Jun 23, 2016

Fix crash with newline-after-import related to the use of switch cases (fixes #386)

The error came because a switch case has a scope

  • I've added a small safe-guard that should prevent the same kind of crash in this part of the code
  • I have made it so no errors can come from inside switch cases. I tried returning the switch case cases items, but then it reports an error even if I space them correctly. Maybe someone wants to take a further look into it, but I'm out of time right now.

cc @ljharb @singles

@jfmengels jfmengels added the bug label Jun 23, 2016
@benmosher
Copy link
Member

LGTM. I thought case branches didn't have a scope without wrapping in an explicit block.

Seems strictly like an improvement to me! Thanks for fixing this!

@benmosher benmosher merged commit a7d627e into master Jun 23, 2016
@jfmengels
Copy link
Collaborator Author

:)

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

Successfully merging this pull request may close these issues.

newline-after-import breaks
2 participants