-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
cgen: fix C struct sumtype support #21129
Conversation
ive tested this pr with the uing code and it builds but crashes. the resulting C code looks like this:
so it seems there's an extra abstraction for V sumtypes but it should just do a plain cast. Because i'm using a V struct as the public interface for those C.uiX structs which makes the public interface V-friendly while keeping the C structs internal to the module. So not sure if that's intended to be used that way |
Yes, thanks for testing. I'll need to change a bit the sumtype implementation after the major PR about sumtype get merged. |
still seems to not make my code to work, sumtypes contain the data and the type, while i think for those cases it should just pass the data :? but at least its getting closer. also another issue is that in my case i want Control to be a sumtype for Box, Label, Button.. but at the same time all those Box Label Button types should be castable to C.uiControl. so there's an extra level of indirection in my case.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work.
Fix #21122