[6.3][Concurrency] A few fixes for default isolation inference #87041
+174
−13
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.