Skip to content

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

Merged
benmosher merged 1 commit into
masterfrom
issue-386
Jun 23, 2016
Merged

Fix crash with newline-after-import related to the use of switch cases (fixes #386)#395
benmosher merged 1 commit into
masterfrom
issue-386

Conversation

@jfmengels

@jfmengels jfmengels commented Jun 23, 2016

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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