- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Can't pass non-nullable pointer to nullable #731
Comments
Maybe it's the nested pointer risk in case the callee wanted to change things? But they are const in this case, so seems like it should be presumed safe. |
Moved some code to a separate file, and then this error popped up, too:
It wasn't previously causing this error, so something subtle might be going on, and it might be related to the original error report above, since it's about non-null to null, again. And no nested pointers here, so that should be an issue in this case either. |
I'll get these fixed soon. In the meantime, a workaround is using |
Thanks much. I wasn't fully sure which cast I ought to use. Interestingly enough, this also worked and allowed the later use of &sources without casting:
And for the second case, switching which file the call was in also worked. |
Is your code open source by any chance? So that I could try to repro these bugs? |
It's in this repo: https://github.com/tjpalmer/beast The second case above was happening when the code was in main. |
Thanks! I'll have a look. Unrelated to this bug, one thing I would recommend is to have only a single |
I had them separate so I could more easily relate dependencies and encapsulate. (This code is also early and on limited time, so don't presume everything there is on purpose, though.) So I understand better, what are the reasons for a single @cImport? |
I added to the docs to answer this: http://ziglang.org/documentation/master/#cImport |
Seems like this should be allowed as implicitly compatible (of course, not the other way around):
The text was updated successfully, but these errors were encountered: