Skip to content

[6.2][Concurrency] Infer @preconcurrency @MainActor in default main acto… #81641

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 1 commit into from
May 21, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented May 20, 2025

…r mode for language modes < 6

Cherry-pick of #81627


  • Explanation:

    @MainActor errors are hard errors, even in minimal concurrency checking in Swift 5 mode. When users set the default isolation to main actor, we should infer @preconcurrency @MainActor in language modes < 6 to get the right diagnostic staging behavior.

  • Main Branch PR: [Concurrency] Infer @preconcurrency @MainActor in default main acto… #81627

  • Risk: Low (New check downgrades errors to warnings in -default-isolation MainActor mode which allows more code to type-check).

  • Reviewed By: @hborla

  • Resolves: rdar://151029517

  • Testing: Added new tests to the suite.

(cherry picked from commit 6561476)

…r mode for language modes < 6

`@MainActor` errors are hard errors, even in minimal concurrency checking in Swift 5 mode.
When users set the default isolation to main actor, we should infer `@preconcurrency @MainActor`
in language modes < 6 to get the right diagnostic staging behavior.

Resolves: rdar://151029517
(cherry picked from commit 6561476)
@xedin xedin requested a review from a team as a code owner May 20, 2025 16:10
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels May 20, 2025
@xedin
Copy link
Contributor Author

xedin commented May 20, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented May 20, 2025

@swift-ci please test Windows platform

@xedin xedin merged commit 86699a2 into swiftlang:release/6.2 May 21, 2025
5 checks passed
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.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants