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

// error
//
// :7:19: error: comptime control flow inside runtime block
// :6:17: note: runtime control flow here