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: allow blank lines and comments in cases that do not stop execution #1275

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

koh28
Copy link

@koh28 koh28 commented May 13, 2024

Fixes #1196

This PR allows:

switch (number) {
  case 1:
    // comment
  case 2:
    doSomething();
}
switch (number) {
  case 1:
    
  case 2:
    doSomething();
}

but does not allow:

switch (number) {
  case 1:
    // comment
    doSomething();
  case 2:
    doSomething();
}

@CLAassistant
Copy link

CLAassistant commented May 13, 2024

CLA assistant check
All committers have signed the CLA.

@bartlomieju
Copy link
Member

Hey @koh28, thanks for the PR. Can you please sign the CLA so we can land this PR?

@koh28
Copy link
Author

koh28 commented May 15, 2024

I signed it

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.

Fallthrough is not allowed when adding comment above switch case
3 participants