We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi !
I found a funny bug when experimenting with Gleam 1.7.0. The following code:
pub type A { A(b: B) } pub type B { B(c: C) } pub type C { C(val: Int) } pub fn example(a: A) { A(..a, b: { B(..a.b, c: { C(..a.b.c, val: 0) }) }) }
Compiles incorrectly to:
example(A) -> _record = A, {a, (_record@1 = erlang:element(2, A), {b, (_record@2 = erlang:element(2, erlang:element(2, A)), {c, 0})})}.
Which is invalid, the (_record, { pattern is not working, but when removing the block pattern, like this:
(_record, {
pub fn example(a: A) { A(..a, b: B(..a.b, c: C(..a.b.c, val: 0) ) ) }
Compiles correctly to:
example(A) -> _record = A, {a, begin _record@1 = erlang:element(2, A), {b, begin _record@2 = erlang:element(2, erlang:element(2, A)), {c, 0} end} end}.
It triggers a hard to understand build error looking like (because of a , error)
,
project/src/module.gleam: spec for undefined function example/1 % 32| A(..a, b: B(..a.b, c: { C(..a.b.c, val: 0) })) % | ^
Edit: I made sure it's working with JS: everything gets compiled as IIFE, so there's no problem.
The text was updated successfully, but these errors were encountered:
Oh yikes. Thank you
Sorry, something went wrong.
Oh no fixing this asap. sorry.
Thank you 💜
check for needs_begin_end_wrapping instead of only checking for pipel…
59af3e0
…ines when emiting single-statement blocks fix gleam-lang#4154
72d54e6
Successfully merging a pull request may close this issue.
Hi !
I found a funny bug when experimenting with Gleam 1.7.0.
The following code:
Compiles incorrectly to:
Which is invalid, the
(_record, {
pattern is not working, but when removing the block pattern, like this:Compiles correctly to:
It triggers a hard to understand build error looking like (because of a
,
error)Edit: I made sure it's working with JS: everything gets compiled as IIFE, so there's no problem.
The text was updated successfully, but these errors were encountered: