zig/test/cases/catch_at_comptime.4.zig

11 lines
170 B
Zig

pub fn main() void {
const a: anyerror!u32 = error.Bar;
a catch |err| assert(err == error.Bar);
}
fn assert(b: bool) void {
if (!b) unreachable;
}
// run
//