-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances. #79893
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
[Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances. #79893
Conversation
@swift-ci please smoke test |
0240c50
to
5825021
Compare
@swift-ci please smoke test macOS |
@swift-ci please smoke test |
@swift-ci please smoke test macOS |
ea05478
to
ce45f27
Compare
@swift-ci please smoke test |
ce45f27
to
5143a40
Compare
…from protocol conformances.
…e kind is explicit.
5143a40
to
083962d
Compare
083962d
to
82497af
Compare
@swift-ci please test |
I might be missing it but I think the change is missing the motivating test case, which is something like this: struct TestIsolated: Refined {
func test() {
}
}
nonisolated func callTest(t: TestIsolated) {
t.test() // okay
} Without this change, the explicit |
@hborla I think that's covered in https://github.com/swiftlang/swift/pull/79893/files#diff-b3821b096ff745e478a46286c05681e14b2ede3f7b05b6a882b78b84fa03c170R148, isn't it? |
Is that missing a protocol requirement? |
|
Oh I see it, I overlooked |
…make witnesses nonisolated Even if the requirement is stated on an isolated protocol if the conformance is implied by a nonisolated one all of the requirements and witnesses should be nonisolated.
@swift-ci please test |
…override `nonisolated`. Follow-up for swiftlang#79893. More than one global actor isolated conformance at any level creates a clash and conforming type should be inferred as `nonisolated`. Resolves: rdar://154202375
…override `nonisolated`. Follow-up for swiftlang#79893. More than one global actor isolated conformance at any level creates a clash and conforming type should be inferred as `nonisolated`. Resolves: rdar://154202375 (cherry picked from commit 2e1fe44)
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.Resolves rdar://144798727.