Skip to content

[Concurrency] Infer nonisolated for a mutable storage of a value type accessed from within the module. #72473

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

Conversation

simanerush
Copy link
Member

A mutable storage of a globally-isolated value type is data-race safe because it is copied every time it crosses an isolation boundary.

Thus, treat such storage as nonisolated when accessed from within the module.

I have removed redundant errors from the tests that access such properties, and it seems like the derived_conformances_nonisolated.swift test becomes the primary test for this PR.
I am not fully convinced that removing errors from global_actor_inference.swift is right, so I would appreciate feedback on that!

This PR is the first part of the implementation of this pitch

@simanerush simanerush marked this pull request as ready for review March 20, 2024 23:19
@simanerush
Copy link
Member Author

@swift-ci please smoke test macOS

@simanerush simanerush force-pushed the nonisolated-property-struct-inference branch from dffe45d to 05859b4 Compare March 24, 2024 03:03
@simanerush
Copy link
Member Author

@swift-ci please smoke test

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