Skip to content

Improve (nonisolated) let checking #38118

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 2 commits into from
Jun 28, 2021

Conversation

DougGregor
Copy link
Member

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 and will be implicitly async.

While I'm here, require the types of 'nonisolated' declarations to be
Sendable, e.g., a nonisolated let must have Sendable type
for it to make sense.

Fixes rdar://78274621

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.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit d312e80 into swiftlang:main Jun 28, 2021
@DougGregor DougGregor deleted the nonisolated-let-checking branch June 28, 2021 21:06
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.

1 participant