News for hackers. Stuff that matters.
Re:Zig self hosted compiler is now capable of building itself by abbeyj on Saturday April 16, 2022 @12:59PM (#31053949)
If the union is untagged, how can it be determined (at runtime) that you've accessed the wrong field?
Re:Zig self hosted compiler is now capable of building itself by Spex_guy on Saturday April 16, 2022 @05:38PM (#31056319)
The compiler adds a tag in debug modes, but not in release modes.
Re:Zig self hosted compiler is now capable of building itself by a_t48 on Saturday April 16, 2022 @09:53PM (#31057750)
Neat, that's somewhere in between a `union` and a `std::variant`. You could build your own, but it's cool that it's a first class member of the language.