-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Assertion failed in get_struct_type when return type of frame struct member is error union #8654
Copy link
Copy link
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Milestone
Description
The following top-level scope code
frame: @Frame(hkm),
fn hkm(_: void) !void {}crashes the compiler with
Assertion failed at /home/vsts/work/1/s/src/stage1/analyze.cpp:2261 in get_struct_type. This is a bug in the Zig compiler.thread 29889 panic:
Unable to dump stack trace: debug info stripped
This also occurs if a sub-frame returns error union. Frame functions taken from a submodule is also affected.
const H = struct {
pub fn soor() void {
const h: @Frame(rfnj) = undefined;
}
fn rfnj(_: void) !void {}
};
frame: @Frame(H.soor),But if the frame is not a top-level member, the error doesn't occur:
const Hkm = struct {
frame: @Frame(hkm),
fn hkm(_: void) !void {}
};
comptime {
_ = Hkm;
}It's also fixed by removing all arguments of the frame function, or changing the return type to something other than an error union.
Using zig-linux-x86_64-0.8.0-dev.2064+da9da76e3.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior