aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/switch_on_undefined_union.zig
AgeCommit message (Collapse)Author
2025-03-29compiler: "illegal behavior", not "undefined behavior", in errorsmlugg
2024-02-26Sema: fix compile error for switching on undefined unionJohn Schmidt
Before this fix, passing an undefined union value to `Sema.switchCond` returned an undefined value of the union type, not the tag type, since `Value.unionTag` forwards undefined values unchanged. This leads us into the `.Union` branch in `Sema.zirSwitchBlock` which is unreachable, now we take the `.Enum` branch instead.