Skip to content

Conversation

@AnthonyLatsis
Copy link
Collaborator

@AnthonyLatsis AnthonyLatsis commented May 1, 2022

  • Description: Protocol composition minimization has a fast path for the case of a single requirement in the existential signature. This fast path was also supposed to prevent us from falling through to constructing a protocol composition with a single component and hitting an assertion in ProtocolComposition::build. When opened archetype signatures were upgraded to encompass surrounding generic contexts, the fast path ceased to serve this purpose in the presence of requirements on other generic parameters.
  • Scope: Redeclaration checking involving subclass existentials.
  • Risk: Low.
  • Reviewers: @slavapestov
  • Testing: Regression tests.
  • Original PR: AST: Fix bug in subclass composition minimization #58554

Now that opened archetype signatures are generalized to encompass outer generic
contexts, the number of requirements in the generic signature is not always
indicative of whether the minimal type is also a composition.
Trust the `GenericSignature` class with upholding its invariants and assert
that a superclass bound is in the right place instead of prepending it.
@AnthonyLatsis AnthonyLatsis requested a review from a team as a code owner May 1, 2022 12:15
@slavapestov
Copy link
Contributor

@swift-ci Please test

@AnthonyLatsis AnthonyLatsis merged commit 1cf0345 into swiftlang:release/5.7 May 2, 2022
@AnthonyLatsis AnthonyLatsis deleted the 5.7-min-comp-fix branch May 2, 2022 10:00
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 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 swift 5.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants