aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/while_expected_optional_got_bool.zig
blob: 5ced72b492666c488df3014da2c199a9bea0d5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export fn foo() void {
    while (bar()) |x| {
        _ = x;
    }
}
fn bar() bool {
    return true;
}

// error
// backend=stage2
// target=native
//
// :2:15: error: expected optional type, found 'bool'