aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_noreturn.zig
blob: c0dfd2d570815a8af94eebee9e4898b00fc48be2 (plain)
1
2
3
4
5
6
7
8
9
10
fn foo(condition: bool, b: u32) void {
    const a = if (condition) b else return;
    _ = a;
    @panic("do something with a");
}
test "noreturn" {
    foo(false, 1);
}

// test