[6.1]Revert [ConformanceLookup] Don't allow skipping inherited unavailable conformances in favor of explicit available ones. #79596
+49
−149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation: [ConformanceLookup] Don't allow skipping inherited unavailable conformances in favor of explicit available ones. #75135 exposed a few incorrect
Sendable
annotations in libraries. Most notably,Formatter
inFoundation
has an unavailable conformance toSendable
, while subclasses includingDateFormatter
have an available conformance toSendable
. This is not supported; types can only have one conformance to a protocol. If a superclass wants to allow subclasses to have differing availability on a particular protocol conformance, the subclass should have no conformance to that protocol at all. The fix is to remove the unavailableSendable
conformance onFormatter
in Foundation. This revert is a workaround until libraries have time to update their conformances.This impact is programmers will miss out on redundant
Sendable
conformance warnings, and observe unexpected behavior for code that declares both an unavailable conformance and an available conformance toSendable
(which is already the case in Swift 6.0).Note that I did not revert [Concurrency] Don't warn about re-stating inherited unavailable conformances to
Sendable
. #75359. It should not have any impact. The Swift 6.0 compiler has the exact same set of reverts.Scope: Only impacts redundant conformances to
Sendable
where at least one of the conformances is unavailable.Issues: Swift 6.1 regression in Sendable checking #78635
Original PRs: There is no
main
PR for this revert. This revert is forrelease/6.1
only. The compiler change is correct, but there are a handful of incorrectSendable
annotations in libraries that should be fixed before this change lands to avoid source compatibility issues in client projects.Risk: Low; this change restores the behavior before [ConformanceLookup] Don't allow skipping inherited unavailable conformances in favor of explicit available ones. #75135 and [Conformance] Always downgrade redundant conformances to marker protocols to a warning. #75425. These changes were reverted from
release/6.0
for a different reasonTesting: N/A
Reviewers: @bnbarham @DougGregor