Zig Version
0.14.0-dev.2634+b36ea592b
Steps to Reproduce and Observed Behavior
conststd=@import("std");
fnmaybeError(x: u32) !u32 {
returnif (x%2==0) error.Errorelsex;
}
exportfnmain() noreturn {
constx=maybeError(5) catchpanic();
std.debug.print("{}\n", .{x});
while (true) {}
}
pubfnpanic() noreturn {
while (true) {}
}zig build-obj main.zig has the following output
thread 19206 panic: parameter count mismatch calling builtin fn, expected 0, found 3
Unable to dump stack trace: debug info stripped
fish: Job 1, 'nix run 'github:mitchellh/zig-o…' terminated by signal SIGABRT (Abort)
Expected Behavior
0.13.0 prints an error and doesn't crash:
/nix/store/s3nq31mhm8gxkq691p5w6q61ficw1hvr-zig-0.13.0/lib/std/builtin.zig:751:9: error: expected type 'fn ([]const u8, ?*builtin.StackTrace, ?usize) noreturn', found 'fn () noreturn'
root.panic
~~~~^~~~~~
/nix/store/s3nq31mhm8gxkq691p5w6q61ficw1hvr-zig-0.13.0/lib/std/builtin.zig:751:9: note: function with 0 parameters cannot cast into a function with 3 parameters
Zig Version
0.14.0-dev.2634+b36ea592b
Steps to Reproduce and Observed Behavior
zig build-obj main.zighas the following outputExpected Behavior
0.13.0 prints an error and doesn't crash: