[6.2][Concurrency] SE-0449: Fix a few issues related to nonisolated
type declarations
#82324
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.
Cherry-pick of #79893, #82289
Explanation:
If the protocol from the conformance list explicitly strips off global actor with
nonisolated
, make sure to look for this explicit isolation source when computing the resulting isolation; to prevent accidental global actor inference on the conforming type.If a
nonisolated
type conforms to a global-isolated protocol the witnesses to the protocol requirements should infer the isolation from the protocol but instead benonisolated
.Resolves: rdar://144798727, rdar://145519840
Main Branch PRs: [Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances. #79893, [Concurrency] SE-0449:
nonisolated
on a type should prevent isolati… #82289Risk: Low. The change affects only declarations that conform to
nonisolated
protocols or declare asnonisolated
type.Reviewed By: @ktoso @hborla
Testing: Added new test-cases to the Concurrency test suite.