Skip to content

[concurrency] Wire up execution(concurrent)/execution(caller) #78997

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 7 commits into from
Jan 30, 2025

Conversation

gottesmm
Copy link
Contributor

Just landing this before I do some larger refactoring around flipping the meaning of ActorIsolation::Nonisolated/CallerIsolatedInheritance.

…to a more logical place.

Specifically, rather than performing the interception in ActorIsolationRequest
itself after we have returned an actor isolation from
getIsolationFromAttributes, just do it in getIsolationFromAttributes.

The reason I am doing this is then the code around how we infer isolation in
such a case is centralized in getIsolationFromAttributes instead of being in
both places.

This is a NFC change.
…o the attribute checker.

This never belonged in ActorIsolationRequest since it fits perfectly in the
attribute checker. This also simplifies the logic before I add code to
getIsolationFromAttribute to handle ExecutionAttribute.
…ation to match nonisolated.

Specifically, we were attempting to diagnose cases like the following:

```swift
@mainactor protocol P {
  func foo() async
}

struct S : P {
  @execution(concurrent) func foo() async {}
}
```

This was just an attempt to be more conservative. After some conversations, it
came up that nonisolated does not work that way... that is the compiler will
accept the following and just hop in the protocol witness thunk:

```swift
@mainactor protocol P {
  func foo() async
}

struct S : P {
  nonisolated func foo() async {}
}
```
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit 3772032 into swiftlang:main Jan 30, 2025
3 checks passed
@gottesmm gottesmm deleted the wire-up-execution branch January 30, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants