We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Could be related to #624 and/or #679
zig version 0.2.0+55193cb1
Test case:
const my_callback_h = fn (*MyStruct) error!void; const MyStruct = struct { callback: my_callback_h, fn init(cb: my_callback_h) MyStruct { return MyStruct { .callback = cb, }; } }; fn main_callback(ms: *MyStruct) error!void { return; } pub fn main() void { var a = MyStruct.init(main_callback); }
Returns
main.zig:1:1: error: 'my_callback_h' depends on itself const my_callback_h = fn (*MyStruct) error!void; ^
The text was updated successfully, but these errors were encountered:
Here's a workaround in the meantime:
const my_callback_h = fn (*MyStruct) error!void; const MyStruct = struct { callback: fn (*MyStruct) error!void, fn init(cb: fn (*MyStruct) error!void) MyStruct { return MyStruct{ .callback = cb }; } }; fn main_callback(ms: *MyStruct) error!void { return; } pub fn main() void { var a = MyStruct.init(main_callback); }
Sorry, something went wrong.
I'm pretty sure this is a duplicate of #624 and not #679. I'll leave it open until this test case is covered.
fixed by #2174
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Could be related to #624 and/or #679
zig version
0.2.0+55193cb1
Test case:
Returns
The text was updated successfully, but these errors were encountered: