Skip to content

Reparenting: third batch of fixes#87056

Merged
kavon merged 3 commits intoswiftlang:mainfrom
kavon:retro-refinement-4
Feb 7, 2026
Merged

Reparenting: third batch of fixes#87056
kavon merged 3 commits intoswiftlang:mainfrom
kavon:retro-refinement-4

Conversation

@kavon
Copy link
Member

@kavon kavon commented Feb 7, 2026

  • Allow conditional conformances to, e.g., Sequence to imply conformance to BorrowingSequence, because the latter is @reparentable.

rdar://169878220

kavon added 3 commits February 6, 2026 13:23
We were walking the extensions of protocols in
requirement lowering and in getInheritedProtocols
to also count the @reparented entries in all
extensions. I had already seen some request
evaluator cycles triggered by this with objc
protocols, and it seems unnessecary as it's
actually a benefit to force people to write the
inheritance on the protocol itself.
The `@reparented` was missing and a typealias
was being synthesized unexpectedly, creating
an issue when typechecking the interface later.

There's no fundamental reason why typealiases
cannot be supported to say the same thing as
the same-type requirement, but I think the
same-type requirement is always needed to be
written on the extension, one way or another.

For now I've chosen to only go with an
explicitly-written same-type requirement.
The only way to avoid a source break when introducing a
reparenting is to allow implied conditional conformance
to a @reparentable protocol, as prior code would not have
explicitly stated it.
@kavon kavon marked this pull request as ready for review February 7, 2026 05:01
@kavon
Copy link
Member Author

kavon commented Feb 7, 2026

@swift-ci smoke test

@kavon kavon enabled auto-merge February 7, 2026 05:02
@kavon kavon merged commit f00f6aa into swiftlang:main Feb 7, 2026
3 checks passed
@kavon kavon deleted the retro-refinement-4 branch February 7, 2026 17:19
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.

1 participant