Skip to content

[5.2][CodeCompletion] Use GenericSignature methods to get 'associatedtype' requirements #29104

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

rintaro
Copy link
Member

@rintaro rintaro commented Jan 9, 2020

Cherry-pick of #29086 into swift-5.2-branch originally reviewed by @slavapestov

rdar://problem/57245073

…tRequirementSignature()

instead of AssociatedTypeDecl::getInherited() when checking if the
return type should be suggested as "opaque result type" in override
completion.

AssociatedTypeDecl::getInherited() is not serialized. So if the protocol
is declared in a module, it was never suggested as 'some' result.

rdar://problem/57245073
(cherry picked from commit e388c4a)
in override completion. As per SE-0244:

> Associated type inference can only infer an opaque result type for a
> non-generic requirement, because the opaque type is parameterized by
> the function's own generic arguments

(cherry picked from commit 1dd6fe5)
@rintaro rintaro requested a review from a team as a code owner January 9, 2020 22:46
@rintaro
Copy link
Member Author

rintaro commented Jan 9, 2020

@swift-ci Please test

@DougGregor DougGregor merged commit dce5ddc into swiftlang:swift-5.2-branch Jan 13, 2020
@rintaro rintaro deleted the 5.2-ide-completion-opaqueresult-rdar57245073 branch January 13, 2020 19:22
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