about summary refs log tree commit diff
path: root/lang/zig/noreturn.zig
blob: 6f88de1f986760fdbf1f36e5b0a608cf4cbd06aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
const expect = @import("std").testing.expect;

fn foo(condition: bool, b: u32) void {
    const a = if (condition) b else return;
    @panic("do something with a");
}

test "noreturn" {
    foo(false, 1);
}