aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/switch_expression-non_exhaustive_unreachable_else.zig
blob: 3b681c6c8ac1b729b32b4277e6bcc9394cc9c36f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const E = enum(u8) {
    a,
    b,
    _,
};

export fn f(e: E) void {
    switch (e) {
        .a, .b, _ => {},
        else => {},
    }
}

// error
//
// :10:14: error: unreachable else prong; all explicit cases already handled