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

Adjust indentation of line comments inside expression switches #1111

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

copybara-service[bot]
Copy link

Adjust indentation of line comments inside expression switches

For statement switches there's some ambiguity about whether a comment documents the previous or next case:

  case 1:
    // case 1 falls through to 2
  case 2:
    doSomething()
  // this is information about case 1
  case 1:
  // this is information about case 2
  case 2:
    doSomething()

For expression switches there is no fall through, so assume that a line comments before a case label always apply to the case label after it.

For statement switches there's some ambiguity about whether a comment documents the previous or next case:

```
  case 1:
    // case 1 falls through to 2
  case 2:
    doSomething()
```

```
  // this is information about case 1
  case 1:
  // this is information about case 2
  case 2:
    doSomething()
```

For expression switches there is no fall through, so assume that a line comments before a case label always apply to the case label after it.

PiperOrigin-RevId: 644163145
@copybara-service copybara-service bot merged commit 3affd63 into master Jun 17, 2024
@copybara-service copybara-service bot deleted the test_644118711 branch June 17, 2024 23:06
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.

1 participant