#zig build-obj {
--name test -fno-emit-bin
-Mroot=test.zig
#}

#write test.zig {
const E = enum(u8) {
    a,
    b,
    _,
};
const U = union(E) {
    a: i32,
    b: u32,
};
export fn entry1() void {
    const e: E = .b;
    switch (e) {
        .a => {},
        _ => {},
    }
}
export fn entry2() void {
    const e: E = .b;
    switch (e) {
        .a => {},
        .b => {},
    }
}
export fn entry3() void {
    const u = U{ .a = 2 };
    switch (u) {
        .a => {},
        .b => {},
        _ => {},
    }
}
#}
#update
#check errors {
test.zig:12:5: error: switch must handle all possibilities
test.zig:3:5: note: unhandled enumeration value: 'b'
test.zig:1:11: note: enum 'test.E' declared here
test.zig:19:5: error: switch on non-exhaustive enum must include 'else' or '_' prong or both
test.zig:26:5: error: '_' prong only allowed when switching on non-exhaustive enums
test.zig:29:9: note: '_' prong here
test.zig:26:5: note: consider using 'else'
#}
