New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stage2: Compiler crash with "panic: zig compiler bug: GenericPoison" #12373
Comments
I met the same problem. Zig Version0.10.0-dev.3871+b7d5582de Steps to ReproduceTrying to run below code with const std = @import("std");
pub fn main() !void {
f(std.log.warn);
}
pub fn f(pf: *const fn (a: []const u8, anytype) void) void {
pf("", .{});
} Expected BehaviorSuccess to compile and exit with stdout message. warn: Actual BehaviorCompiler crashes with the message: thread 21735 panic: zig compiler bug: GenericPoison |
Stack trace for the first one:
Stack trace for the second one:
|
Similar problem for me 👀 I passed a function that does not match the type signature. And got
|
I believe I've encountered the same issue, although with maybe a bit simpler of a reproduction? fn read_vector(comptime T: type, allocator: Allocator, reader: anytype, comptime callback: fn (anytype) anyerror!T) ![]T {
const len = try read_u32(reader);
const result = try allocator.alloc(T, len);
errdefer allocator.free(result);
for (result) |*element| {
element.* = try callback(reader);
}
return result;
} calling this with a callback that takes the wrong parameters, causes the error. |
I'm getting an error with the same name. It started with the new splatting syntax, although I haven't been able to isolate the issue. I'm unable to fix the build, so I'm using an older compiler for now. |
Zig Version
0.10.0-dev.3475+b3d463c9e
Steps to Reproduce
Try testing the following code with
zig test -fno-stage1 -fLLVM a.zig
:Expected Behavior
I would expect a compilation error, like struct doesn't have a field "x".
Actual Behavior
Compiler crashes with the message:
The text was updated successfully, but these errors were encountered: