[6.0] Change behavior of implied 'Sendable' conformance #74914
Merged
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.
6.0 cherry-pick of #74908
Description: If a type conditionally conforms to two protocols that both adopt Sendable retroactively, we would attempt to synthesize two conditional conformances to Sendable with incompatible requirements. Instead, change it so that the implied Sendable conformance is unconditional in
-swift-version 5
mode, and ban it outright in-swift-version 6
.Origination: This is a long-standing issue with conditional conformances, where the original Sendable carveout never quite worked right.
Reviewed by: @DougGregor
Risk: Low. We might now diagnose a non-Sendable stored property in more cases, because the Sendable conformance is unconditional, but in
-swift-version 5
this was a warning, so this should not be a source break. In-swift-version 6
, the new behavior is source breaking because the implied Sendable conformance must be declared explicitly. However, this matches the intent of-swift-version 6
.Radar: rdar://95695543, rdar://122754849.