-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Replace enum fields idents with syms #14048
Conversation
compiler/semtypes.nim
Outdated
@@ -62,6 +62,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = | |||
counter, x: BiggestInt | |||
e: PSym | |||
base: PType | |||
identToReplace: PNode |
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.
I'd prefer identToReplace: ptr PNode
.
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.
done
This is a breaking change and needs a migration mechanism. |
old behaviour can now be restored with Ready for review |
good PR but The correct way to handle breaking changes is simple and involves both:
For testing legacy, we avoid combinatorial explosion by only testing releases eg |
@timotheecour I'm aware and will change it but was tired of the review ping-pong and so took the shortcut and merged it already. |
During review of #14030 and #14046 I found there is problem with
getImpl()
for enum types.Fields are idents and not syms. This makes hard to write typed macros. You have to generate
EnumType.X
everywhere instead ofX
. But it doesn't work for bool enum type.bool.true
is not valid.