Skip to content

[SE-0470] Enable isolated conformances by default #80810

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

Merged
merged 13 commits into from
Apr 15, 2025

Conversation

DougGregor
Copy link
Member

  • Explanation: Enable isolated conformances (SE-0470) by default, including a number of bug fixes to the feature and improvements for source compatibility.
  • Scope: This language change intentionally introduces some new concurrency-related diagnostics, because some metatypes that were previously Sendable are now non-Sendable. The implementation includes logic to downgrade concurrency-related errors due to this issue to warnings, even in Swift 6, to mitigate the source incompatibility this change introduces. However, it is possible that some source incompatibilities were not found in the source-compatibility suite or normal CI.
  • Issues: rdar://146116559
  • Original PRs: [SE-0470] Enable isolated conformances by default #80702
  • Risk: Moderate. Most of the riskier parts of isolated conformances (e.g., in the runtime) have already landed, so the main risk here comes from the source compatibility issues described above.
  • Testing: CI, source compatibility suite.
  • Reviewers: @xedin

…gnatureImpl

This is going to need a proper implementation in the requirement
machine. For the moment, provide a slightly-less-broken implementation
but leave a test case where we incorrectly accept racey code.

(cherry picked from commit 92774e0)
The IsolatedConformances feature moves to a normal, supported feature.
Remove all of the experimental-feature flags on test cases and such.

The InferIsolatedConformances feature moves to an upcoming feature for
Swift 7. This should become an adoptable feature, adding "nonisolated"
where needed.

(cherry picked from commit 3380331)
…ol requirements as Sendable

A metatype for an archetype or existential with no (non-marker)
protocol requirements cannot, by definition, carry any (isolated)
protocol conformances with it, so it's safe to treat such metatypes as
Sendable.

(cherry picked from commit 8626404)
…ble metatypes

The code that determines whether a reference to a static method (that
is not a call) assumed that metatypes were always Sendable. This is no
longer the case, so update this code to go through the normal Sendable
checking on the metatype.

(cherry picked from commit 3ed1d6c)
…le metatypes

The introduction of non-Sendable metatypes in Swift 6.2 (via SE-0470)
will break some existing Swift 6 code. Downgrade concurrency errors
involving non-Sendable metatypes to warnings until some future
language mode to ease the transition.

(cherry picked from commit 95b18d3)
…ing possibly-nonsendable metatypes

Thank you, Pavel!

(cherry picked from commit 88d6304)
@DougGregor DougGregor requested a review from a team as a code owner April 14, 2025 23:56
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge April 15, 2025 00:15
@DougGregor
Copy link
Member Author

@swift-ci please test source compatibility

@DougGregor
Copy link
Member Author

@swift-ci please test Linux

@DougGregor DougGregor disabled auto-merge April 15, 2025 02:39
@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@DougGregor
Copy link
Member Author

@swift-ci please test macOS

@DougGregor DougGregor enabled auto-merge April 15, 2025 06:44
@DougGregor DougGregor merged commit 4cb4a0b into swiftlang:release/6.2 Apr 15, 2025
7 checks passed
@DougGregor DougGregor deleted the enable-se-0470-6.2 branch April 15, 2025 13:56
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.

3 participants