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

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