aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/discarding_error_value.zig
blob: c24d517d3e3b39133b0e1ec9af2a79239a24df89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export fn entry() void {
    _ = foo();
}
fn foo() !void {
    return error.OutOfMemory;
}

// error
// backend=stage2
// target=native
//
// :2:12: error: error is discarded
// :2:12: note: consider using 'try', 'catch', or 'if'