Skip to content

Fallthrough should not add break; when statements contain a guaranteed return #566

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

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

Conversation

JohannisK
Copy link
Contributor

What's changed?

  • Added test
  • Added check to find guaranteed returns

What's your motivation?

When there is a guaranteed return in a switch case, adding a break; will result in unreachable code.

@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite May 23, 2025
github-actions[bot]

This comment was marked as off-topic.

github-actions[bot]

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant