aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/switch_on_undefined_union.zig
blob: 762363dd0851ae339a9f8bae4b6c0065ba969f5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export fn entry() void {
    const U = union(enum) { a: bool, b: bool };
    switch (@as(U, undefined)) {
        .a, .b => {},
    }
}

// error
// backend=stage2
// target=native
//
// :3:5: error: use of undefined value here causes undefined behavior