Open mooreryan opened 1 month ago
Hello! Thanks for the report.
What is your intent with the code 0 as n:size(8)
? n
here will always equal 0, no?
Potentially something like this:
case n {
<<0 as n:size(8), _:bytes>> | <<1 as n:size(8), _:bytes>> -> // ... do something with `n`
_ -> todo
}
But additionally, <<_ as n:size(8), _:bytes>>
and <<0:size(8), _ as n:bytes>>
also trigger the same crash.
(I suppose it may be rather a bug somewhere else, as the tooling (for vscode at least) is fine with all of the mentioned forms, whereas the compiler itself is the thing that crashes.)
Nice, thank you
I have triggered a compiler crash when pattern matching on bit arrays.
Versions
Gleam version 1.2.1 OS: Ubuntu 22.04.4
Steps to reproduce
The code is this:
It is the
0 as n:size(8)
that seems to be the issue. Also if you change to this<<_ as n:size(8), _:bytes>>
or this<<0:size(8), _ as n:bytes>>
, you will also get the compiler crash.Compiler trace
trace.txt