-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Devirtualize: Skip requirements with covariant 'Self' nested inside a collection #39137
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
Conversation
@swift-ci please test |
Is a cherry-pick needed for the release branch? |
// like '[Self]' or '[* : Self]'. | ||
const Type interfaceTy = wmi->getMember() | ||
.getDecl() | ||
->getInterfaceType() |
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 is just getResultInterfaceType()
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.
getResultInterfaceType()
is not a member of AbstractFunctionDecl
, only FuncDecl
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.
ConstructorDecl and DestructorDecl cannot return a collection of Self though, so FuncDecl is the only relevant case here.
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.
We need to exclude other covariant positions as well, like init(([Self])->Void)
.
Can you add a test case? |
… collection The devirtualizer does not support handling these yet, which wasn't anticipated in swiftlang#34140
e013bbf
to
b81db7a
Compare
How does this look? |
ping |
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.
Do you want to try fixing the underlying bug here too?
Thanks!
I'd love to once SE-309 is completed. |
@swift-ci Please smoke test |
The devirtualizer does not support handling these yet, which wasn't anticipated in #34140