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
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: