-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Assertion failed at analyze.cpp:605 in get_pointer_to_type_extra2 #4246
Comments
Duplicate of #3610 (the stack trace is slightly different as some compiler internals have changed since then). Two questions arise:
|
Related: #4016 |
Easy question first:
Yes,
Currently the language defines pointers to 0-bit types to also be 0-bit types, e.g. they have no actual address. I think the answer to how this should behave can be derived by thinking about what So However it would work fine if both types were 0-bit. And it would work the other way: As far as implementing this in the compiler goes, there is a footgun to look out for, which is that |
Ran into this issue myself in a slightly different way with another weird 0 bit type case partially due to a bug on my part, but I felt I'd add it here in case it is useful. Not exactly sure where in the standard library the issue is coming from, but the code that caused it is essentially this:
Of course if I took
|
No longer relevant with #6706 |
zig version 0.5.0+e491b2f5a
Small reproducible:
Compilation fails with:
Assertion failed at /deps/zig/src/analyze.cpp:605 in get_pointer_to_type_extra2. This is a bug in the Zig compiler.
The text was updated successfully, but these errors were encountered: