Meg's Mirrors
zig
about
heads
tags
log
tree
search
Search
zig
test
cases
compile_errors
switch_on_undefined_union.zig
pretty
plain
permalink
blame
history
•
10 lines
•
217 B
1
export fn entry() void {
2
const U = union(enum) { a: bool, b: bool };
3
switch (@as(U, undefined)) {
4
.a, .b => {},
5
}
6
}
7
8
// error
9
//
10
// :3:5: error: use of undefined value here causes illegal behavior