Skip to content

[6.3][Concurrency] A few fixes for default isolation inference#87041

Open
xedin wants to merge 2 commits intoswiftlang:release/6.3from
xedin:rdar-164077275-6.3
Open

[6.3][Concurrency] A few fixes for default isolation inference#87041
xedin wants to merge 2 commits intoswiftlang:release/6.3from
xedin:rdar-164077275-6.3

Conversation

@xedin
Copy link
Contributor

@xedin xedin commented Feb 6, 2026

  • Explanation:

    Fixes a few issues when @MainActor default isolation interacts with modules.

    • Check whether @preconcurrency is supported before adding it

      Don't trasfer "preconcurrency" from isolation onto a declaration if
      the declaration doesn't support it. This is especially important for
      MainActor by default mode where each @MainActor injection site
      gets marked as @preconcurrency implicitly in pre-6 language modes.

    • Add isolation attributes to declarations inferred as @MainActor

      When declaration gets inferred as @MainActor that needs to be
      reflected in its attributes as well because that's the only reliable
      way propagate isolation across modules.

  • Resolves: rdar://164077275, .swiftinterface emits invalid @preconcurrency isolated deinit #85564

  • Main branch PR: [Concurrency] A few fixes for default isolation inference #86967

  • Risk: Low. This change only matters for printing and serialization when default isolation is set to MainActor.

  • Reviewed By: @hborla

  • Testing: Added new test-cases to the suite.

@xedin xedin requested a review from a team as a code owner February 6, 2026 19:02
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.3 labels Feb 6, 2026
@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2026

@swift-ci please test

@xedin xedin force-pushed the rdar-164077275-6.3 branch from 3db9fcb to 0ba06cd Compare February 7, 2026 16:56
xedin added 2 commits February 7, 2026 08:58
…ing it

Don't trasfer "preconcurrency" from isolation onto a declaration if
the declaration doesn't support it. This is especially important for
`MainActor` by default mode where each `@MainActor` injection site
gets marked as `@preconcurrency` implicitly in pre-6 language modes.

Resolves: swiftlang#85564
(cherry picked from commit 9b8e53c)
…ons inferred as `@MainActor`

When declaration gets inferred as `@MainActor` that needs to be
reflected in its attributes as well because that's the only reliable
way propagate isolation across modules.

Resolves: rdar://164077275
(cherry picked from commit 721723f)
@xedin xedin force-pushed the rdar-164077275-6.3 branch from 0ba06cd to 84bb026 Compare February 7, 2026 16:58
@xedin
Copy link
Contributor Author

xedin commented Feb 7, 2026

@swift-ci please test

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 6.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant