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
Compiler crashes when using short hand union assignment to a static variable #19832
Labels
bug
Observed behavior contradicts documented or intended behavior
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
regression
It worked in a previous version of Zig, but stopped working.
Milestone
Comments
Rhineheart
added
the
bug
Observed behavior contradicts documented or intended behavior
label
May 1, 2024
Vexu
added
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
regression
It worked in a previous version of Zig, but stopped working.
labels
May 1, 2024
The crash is indeed in the frontend:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Observed behavior contradicts documented or intended behavior
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
regression
It worked in a previous version of Zig, but stopped working.
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
Assigning a global static union by short hand syntax crashes the compiler.
Steps to reproduce:
zig init
src/root.zig
with:zig build test
.This gives an output looking something like:
If the static variable is moved into the
crash
function it works fine.Workaround
Leaving it static but using the full name of the union type works fine.
Tested using versions
I've tested this on 0.12.0 on both Windows and Mac, using x86_64 and aarch64 builds respectively. I've also tested this with
zig-0.13.0-dev.46+3648d7df1
giving the same result using the same targets as stated for 0.12.0.This used to work in version:
0.12.0-dev.1349+fa022d1ec
Expected Behavior
Successful compilation. Or an error message if it is intentional.
The text was updated successfully, but these errors were encountered: