mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
15 lines
353 B
Zig
15 lines
353 B
Zig
const assert = @import("std").debug.assert;
|
|
|
|
test "type of unreachable" {
|
|
comptime {
|
|
// The type of unreachable is noreturn.
|
|
|
|
// However this assertion will still fail to compile because
|
|
// unreachable expressions are compile errors.
|
|
|
|
assert(@TypeOf(unreachable) == noreturn);
|
|
}
|
|
}
|
|
|
|
// test_error=unreachable code
|