diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 18:26:01 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-11 18:26:01 -0400 |
| commit | ce5d50e4ed519d23d7a467bdfee196093a3f5dc2 (patch) | |
| tree | c4797424b877cd6b2fdfa15e9a45ee1fdffbe659 /std/special/bootstrap.zig | |
| parent | b3a4ec1bd209c022445b6f70385b3f88517e72f9 (diff) | |
| download | zig-ce5d50e4ed519d23d7a467bdfee196093a3f5dc2.tar.gz zig-ce5d50e4ed519d23d7a467bdfee196093a3f5dc2.zip | |
fix runtime if nested inside comptime if
Diffstat (limited to 'std/special/bootstrap.zig')
| -rw-r--r-- | std/special/bootstrap.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index 45ce23c00f..f1286bd659 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -114,20 +114,20 @@ extern fn main(c_argc: i32, c_argv: [*][*]u8, c_envp: [*]?[*]u8) i32 { // and we want fewer call frames in stack traces. inline fn callMain() u8 { switch (@typeId(@typeOf(root.main).ReturnType)) { - builtin.TypeId.NoReturn => { + .NoReturn => { root.main(); }, - builtin.TypeId.Void => { + .Void => { root.main(); return 0; }, - builtin.TypeId.Int => { + .Int => { if (@typeOf(root.main).ReturnType.bit_count != 8) { @compileError("expected return type of main to be 'u8', 'noreturn', 'void', or '!void'"); } return root.main(); }, - builtin.TypeId.ErrorUnion => { + .ErrorUnion => { root.main() catch |err| { std.debug.warn("error: {}\n", @errorName(err)); if (builtin.os != builtin.Os.zen) { |
