Fix bug in the codegen with a logical guard clauses.#5255
Fix bug in the codegen with a logical guard clauses.#5255vyacheslavhere wants to merge 2 commits intogleam-lang:mainfrom
Conversation
lpil
left a comment
There was a problem hiding this comment.
Thank you! I've left some notes inline 🙏
| in `BitArray`s' `size` option to be `>= 1.12.0`. | ||
| ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) | ||
|
|
||
| - Clause guard with logical expression now compiles correctly in JS. |
There was a problem hiding this comment.
Be more precise with the description please, this sounds like it never worked 🙏
| ----- COMPILED JAVASCRIPT | ||
| export function main(x, y) { | ||
| if (!y && !x) { | ||
| if ((!y && !x)) { |
There was a problem hiding this comment.
It would be good to not have these parens here and in other places they are not needed.
| } | ||
| " | ||
| ) | ||
| } |
There was a problem hiding this comment.
This test is quite complex, so it's hard to understand. Could you simplify it please 🙏
Is this testing what the issue reported? The title of the issue says it's related to instanceof, but this one doesn't use it? I'm finding it hard to understand this due to the complex test.
There was a problem hiding this comment.
Thanks for the feedback, I'll work on it when I have time.
|
I tried to come up with a new solution within the current system. It may be rough, so I am open to suggestions, corrections, etc. |
|
Just a heads up, the test hasn't been simplified yet. |
|
Hi @vyacheslavhere, please mark this as ready-for-review and tag me if you want a review. |
Closes #5254