Skip to content

Dont convert try catch fail when return#566

Merged
timtebeek merged 5 commits intomainfrom
dont-convert-try-catch-fail-when-return
Aug 8, 2024
Merged

Dont convert try catch fail when return#566
timtebeek merged 5 commits intomainfrom
dont-convert-try-catch-fail-when-return

Conversation

@Laurens-W
Copy link
Copy Markdown
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
Copy Markdown
Member

@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
@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