aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/switch_expression-non_exhaustive_inline.zig
blob: 303b762171dd3f28c5d65a7ae9f6e5a4ad712410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const E = enum(u8) {
    a,
    b,
    _,
};

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

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

// error
//
// :10:16: error: cannot inline '_' prong
// :18:16: error: cannot inline '_' prong