aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors/optional_empty_error_set.zig
blob: 9fac5fde6abb362f200dbb404f72d4828fcfa440 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export fn example() void {
    comptime foo() catch |err| switch (err) {};
}
var x: ?error{} = null;
fn foo() !void {
    return x.?;
}
// error
// backend=stage2
// target=native
//
// :6:13: error: unable to unwrap null
// :2:17: note: called at comptime here