Skip to content

GSB: Handle concrete ResolvedTypes in ArchetypeType::resolveNestedType() [5.4] #35404

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

slavapestov
Copy link
Contributor

A nested type of an archetype type might be concrete, for example, via a
same-type constraint:

extension SomeProtocol where SomeAssoc == Int {
  ... Self.SomeAssoc ...
}

This can happen in one of two ways; either the EquivalenceClass of the
nested type has a concrete type, or it is "fully concrete" because
there is no equivalence class and maybeResolveEquivalenceClass() returns
a ResolvedType storing the concrete type.

For some reason we didn't handle the second case here.

This is a slightly simplified version of PR #33859 by @AnthonyLatsis.

Fixes https://bugs.swift.org/browse/SR-13519 / rdar://problem/68531679

A nested type of an archetype type might be concrete, for example, via a
same-type constraint:

extension SomeProtocol where SomeAssoc == Int {
  ... Self.SomeAssoc ...
}

This can happen in one of two ways; either the EquivalenceClass of the
nested type has a concrete type, or it is "fully concrete" because
there is no equivalence class and maybeResolveEquivalenceClass() returns
a ResolvedType storing the concrete type.

For some reason we didn't handle the second case here.

Fixes https://bugs.swift.org/browse/SR-13519 / rdar://problem/68531679
@slavapestov slavapestov requested a review from a team as a code owner January 13, 2021 05:01
@slavapestov
Copy link
Contributor Author

@DougGregor does this look OK for 5.4?

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov changed the title GSB: Handle concrete ResolvedTypes in ArchetypeType::resolveNestedType() GSB: Handle concrete ResolvedTypes in ArchetypeType::resolveNestedType() [5.4] Jan 13, 2021
@slavapestov slavapestov merged commit d795ea7 into swiftlang:release/5.4 Jan 13, 2021
@AnthonyLatsis AnthonyLatsis added swift 5.4 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants