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

Ensure actions can have early returns #1857

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Ensure actions can have early returns #1857

merged 1 commit into from
Mar 25, 2024

Conversation

jwoertink
Copy link
Member

Purpose

Fixes #1843

Description

This may not actually have been a problem to start and possibly just something weird we had in our app ref; however, I decided to still make this change anyway. By moving the call body in to a separate method, the compile-time error is a lot more accurate. Though, it's not as pretty as before, I think the clarity and accuracy outweighs the custom error message.

Also by adding a few comments above the method, you get a little bit of documentation, and the actual action that's failing which should lead you to a fix a bit quicker.

Screenshot from 2024-03-24 16-04-41

See #1843 for more info on the error message change

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

… ensure early returns work and allows Crystal to handle the return type compile errors. Fixes #1843
@jwoertink jwoertink merged commit 74c1ede into main Mar 25, 2024
5 checks passed
@jwoertink jwoertink deleted the issues/1843 branch March 25, 2024 21:22
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.

Unable to do early returns from actions
2 participants