We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
type
&const type
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
const S = struct { T: type }; // error: expected type 'type', found '&const type' // V fn takeS(comptime s: S, a: &s.T) void { } test "" { var a : u8 = 0; const s = S { .T = u8 }; takeS(s, &a); }
Deref the &const type, and we get this error:
const S = struct { T: type }; fn takeS(comptime s: S, a: &*s.T) void { } test "" { var a : u8 = 0; const s = S { .T = u8 }; takeS(s, &a); // error: expected type 'u8', found '&u8' }
The text was updated successfully, but these errors were encountered:
Ooh wait. This is not a bug, but a thing solved my #770
Sorry, something went wrong.
Workaround:
const S = struct { T: type }; fn takePtr(comptime T: type) type { return &T; } fn takeS(comptime s: S, a: takePtr(s.T)) void { } test "" { var a : u8 = 0; const s = S { .T = u8 }; takeS(s, &a); }
No branches or pull requests
Deref the
&const type
, and we get this error:The text was updated successfully, but these errors were encountered: