aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/while_expected_bool_got_optional.zig
blob: 2a2af57ef328dbc37a88d3a8c3abc880d528699c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
export fn foo() void {
    while (bar()) {}
}
fn bar() ?i32 {
    return 1;
}

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