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

Dont convert try catch fail when return #566

Merged
merged 5 commits into from
Aug 8, 2024

Conversation

Laurens-W
Copy link
Contributor

@Laurens-W Laurens-W commented Aug 8, 2024

What's changed?

Add check for try bodies that contain a return statement

What's your motivation?

Solves #547

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

@timtebeek @protocol7

Have you considered any alternatives or workarounds?

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@timtebeek timtebeek self-requested a review August 8, 2024 12:58
@timtebeek timtebeek added the bug Something isn't working label Aug 8, 2024
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work already; one case was missed for nested elements. I've added a quick pattern we use more often when we want to search downwards from a particular elements to handle that correctly. See if you can work out why and how that works. :)

@timtebeek timtebeek merged commit ba9e367 into main Aug 8, 2024
1 of 2 checks passed
@timtebeek timtebeek deleted the dont-convert-try-catch-fail-when-return branch August 8, 2024 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

RemoveTryCatchFailBlocks should not rewrite try blocks that return
2 participants