zig/doc/langref/test_comptime_reaching_unreachable.zig

9 lines
148 B
Zig

comptime {
assert(false);
}
fn assert(ok: bool) void {
if (!ok) unreachable; // assertion failure
}
// test_error=reached unreachable code