Skip to content

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

Merged
merged 1 commit into from
Dec 18, 2021

Conversation

AnthonyLatsis
Copy link
Collaborator

The devirtualizer does not support handling these yet, which wasn't anticipated in #34140

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci please test

@AnthonyLatsis
Copy link
Collaborator Author

Is a cherry-pick needed for the release branch?

// like '[Self]' or '[* : Self]'.
const Type interfaceTy = wmi->getMember()
.getDecl()
->getInterfaceType()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just getResultInterfaceType()

Copy link
Collaborator Author

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

Copy link
Contributor

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.

Copy link
Collaborator Author

@AnthonyLatsis AnthonyLatsis Sep 3, 2021

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).

@slavapestov
Copy link
Contributor

Can you add a test case?

… collection

The devirtualizer does not support handling these yet, which wasn't anticipated in swiftlang#34140
@AnthonyLatsis
Copy link
Collaborator Author

Can you add a test case?

How does this look?

@AnthonyLatsis
Copy link
Collaborator Author

ping

Copy link
Contributor

@slavapestov slavapestov left a 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?

@AnthonyLatsis
Copy link
Collaborator Author

Thanks!

Do you want to try fixing the underlying bug here too?

I'd love to once SE-309 is completed.

@AnthonyLatsis
Copy link
Collaborator Author

@swift-ci Please smoke test

@AnthonyLatsis AnthonyLatsis merged commit 877f68d into swiftlang:main Dec 18, 2021
@AnthonyLatsis AnthonyLatsis deleted the deoptimize branch December 21, 2021 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants