-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Improve (nonisolated) let checking #38119
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
Improve (nonisolated) let checking #38119
Conversation
Implement the remainder of the amendment to SE-0306 "Actors" that considers any reference to an actor-isolated `let` from within a different module like a (mutable) property reference. If such references are from outside the actor, it will be a cross-actor reference at will be implicitly `async`.
A nonisolated declaration is accessible concurrently, so it must be of Sendable type to be safe. This plugs a hole in data-race preventation that will need to be documented in an amendment to SE-0313.
@swift-ci please test |
@swift-ci please nominate |
Build failed |
Build failed |
@swift-ci please test |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
@swift-ci please test macOS |
Build failed |
@swift-ci please test macOS |
Build failed |
@DougGregor, I think this pull may have broken the Windows CI for the 5.5 branch (the trunk branch also may be broken with a different issue), as your previous 5.5 pull #38064 passed the Win CI. Maybe that single failing test can be disabled on Windows for now? |
Explanation: Implement the remainder of the amendment to SE-0306 "Actors" that considers any reference to an actor-isolated
let
from within adifferent module like a (mutable) property reference.
Scope: Only affects programs that have already adopted Swift Concurrency and are using actors across modules. This is technically a source break, but is only in very new code that is using actors and
let
in a non-resilient manner.Radar/SR Issue: rdar://78274621
Risk: Low.
Testing: PR testing and CI on main.
Original PR: #38118