[6.3][Concurrency] A few fixes for default isolation inference#87041
Open
xedin wants to merge 2 commits intoswiftlang:release/6.3from
Open
[6.3][Concurrency] A few fixes for default isolation inference#87041xedin wants to merge 2 commits intoswiftlang:release/6.3from
xedin wants to merge 2 commits intoswiftlang:release/6.3from
Conversation
Contributor
Author
|
@swift-ci please test |
3db9fcb to
0ba06cd
Compare
…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)
0ba06cd to
84bb026
Compare
Contributor
Author
|
@swift-ci please test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
Fixes a few issues when
@MainActordefault isolation interacts with modules.Check whether
@preconcurrencyis supported before adding itDon't trasfer "preconcurrency" from isolation onto a declaration if
the declaration doesn't support it. This is especially important for
MainActorby default mode where each@MainActorinjection sitegets marked as
@preconcurrencyimplicitly in pre-6 language modes.Add isolation attributes to declarations inferred as
@MainActorWhen declaration gets inferred as
@MainActorthat needs to bereflected 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.