-
-
Notifications
You must be signed in to change notification settings - Fork 821
Improve generated code for let assert
on the Erlang target
#4502
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
Improve generated code for let assert
on the Erlang target
#4502
Conversation
This entire portion of code is being worked on by the decision tree PR, which already gets rid of needless checks using the decision tree the compiler produces; and merging this would likely cause loads of conflicts with it. I'd love to avoid that! 😁 |
Ah I see. I thought that PR was only for the javascript target. My bad! |
Ah Gears I'm so sorry I totally messed up! You're right, it is only for the js target 🙇♂️ Sorry again for the confusion! |
All good. I think this implementation is going to be fine for now. I imagine Erlang performs some optimisations using a decision tree also. Perhaps once the plumbing is in place for the decision tree we can improve upon it further |
6af0c8b
to
a167361
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!!
Closes #4497 and fixes #4145
This PR improves the generated code for
let assert
in a couple of ways:case
expression.let
assignment.This simplification fixes the other bug by default, as we no longer ignore variables in the first pattern match.