aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/comptime_continue_inside_runtime_switch.zig
blob: 391ecbdf1a2bc48d09427ec4ca905180a8c07cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export fn entry() void {
    var p: i32 = undefined;
    comptime var q = true;
    inline while (q) {
        switch (p) {
            11 => continue,
            else => {},
        }
        q = false;
    }
}

// error
// backend=stage2
// target=native
//
// :6:19: error: comptime control flow inside runtime block
// :5:17: note: runtime control flow here