My understanding is that tagged union are created via .layout = .Auto, .tag_type = EnumDefinition, but this currently generates compiler errors indicating this union isn't tagged:
Just ran into this myself and I found that you don't need to hijack an existing type, merely store the type info into a variable then pass it to @Type(t).
My understanding is that tagged union are created via
.layout = .Auto, .tag_type = EnumDefinition
, but this currently generates compiler errors indicating this union isn't tagged:@g-w1 mentioned that the stage1 compiler is crossreferencing against the wrong condition: https://github.com/ziglang/zig/pull/8069
Interestingly enough, this seems to work if I hijack an existing tagged union: