-
Notifications
You must be signed in to change notification settings - Fork 52
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
Cleanup return type open syms #261
Conversation
I'm unsure how often we stumble upon this but maybe we need a For example, I'm sure we hit this in serialization libraries macros. I didn't test using taskpools in a generic proc or a template yet but it's very possible as well. |
It would be a bit overkill for this fix, since we can only have OpenSyms AFAICT, but sure would be good to have as a general helper |
nim-lang/Nim#11091 (comment) |
The fix is acceptable but I would do it differently. I would use an |
Not sure I understand @Araq, is it because I modify the AST in place instead of copying it? |
In my experience working with types with macros is fraught with peril nim-lang/RFCs#44 and worse, this might manipulate generics which tend to become a timesink status-im/nimbus-eth2#2219 If we can avoid manipulating types in macros and just modify AST to make it canonical untyped, it will likely save hours of debugging afterwards at the cost of forcing the compiler to redo semcheck/sigmatch. |
And more tests. Follow up of #261
And more tests. Follow up of #261
Fixes status-im/nimbus-eth1#963
For some reason, the code was generating this kind of AST for the return type:
And this "recursive" OpenSymChoice wasn't handled properly by the macro