-
Notifications
You must be signed in to change notification settings - Fork 284
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
meta/codegen.d: Fix getSymbols for dlang/dmd#11320 #2458
base: master
Are you sure you want to change the base?
Conversation
A comment would be nice |
@Geod24 I've edited the description and added links, hope that's ok |
utils/vibe/internal/meta/codegen.d
Outdated
@@ -78,7 +78,7 @@ template getSymbols(T) | |||
alias Implementation = TypeTuple!(); | |||
} | |||
|
|||
alias getSymbols = NoDuplicates!(Implementation!T); | |||
alias getSymbols = NoDuplicates!(staticMap!(Unqual, Implementation!T)); |
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.
This has compile-time performance implications.
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.
Isn't this a breaking change? Wouldn't the original say AliasSeq!(int, const(int))
for int[const(int)]
? alias parameters seem to allow const(int)
to go through, whereas Unqual!(const(int))
turns into int
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.
@schveiguy Oops you're right
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.
Actually I think basic types are ignored anyway
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.
Yep, you are right, I didn't realize that.
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.
Instead of this can you apply Unqual at the leaf instantiations? That would prevent the need for static map.
looking at the usage (figure out which imports need to happen to include these symbols), I think this change is correct in terms of what this thing is meant to do. I would suggest a document comment that clarifies that attributes will be stripped from types. |
This fixes #2455. Instead of changing the assert I just made getSymbols continue dropping qualifiers, because that will work with both existing and future dmd.
See dlang/dmd#11320.