-
Notifications
You must be signed in to change notification settings - Fork 242
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
derive(Debug) for translated types #1034
Comments
I put up a PR for this, but I'm not sure how sound it is: #1040 |
It would be pretty easy to do this post-transpilation by just replacing |
Yeah, I was originally thinking of just doing this post-transpilation, but that seemed brittle, and it wouldn't be great to have to redundantly check for unions after the transpile. I like the idea of supporting other derives. Maybe instead of being a boolean flag, it can be an option that takes a list of traits. I would be concerned, though, that if different traits have different requirements, that could lead to unexpected results. For example, if someone specifies |
Another idea I had was to allow the C data types to be annotated with the traits to derive. My understanding is that this would be difficult to do because it's difficult to attribute comments to AST elements. Is that correct? Is there some other way the AST could be annotated? (This wouldn't actually be helpful for my use case, but now I'm curious) |
Yeah, most things (including types) can have annotations in C with |
It would be great if translated types could implement Debug. Is this something that others might be interested in?
The text was updated successfully, but these errors were encountered: