Skip to content
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

Don't check sendability of witnesses for @preconcurrency conformances #74172

Merged

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jun 6, 2024

When a witness is part of a @preconcurrency conformance, suppress Sendable checking for that witness. The @preconcurrency conformance will dynamically verify that the code is actually executed on the right actor, which addresses most data race issues. Suppressing Sendable checking in this case is a compromise: it makes @preconcurrency conformances usable, but admits a small possibility of data races that will be addressed when the protocol is updated appropriately.

Fixes #74057.

When a witness is part of a `@preconcurrency` conformance, suppress
Sendable checking for that witness because we assume that the caller is
correctly invoking this witness from within the right isolation
domain. This property is dynamically checked.

Fixes swiftlang#74057.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit c5cfe5b into swiftlang:main Jun 7, 2024
3 checks passed
@DougGregor DougGregor deleted the preconcurrency-conformance-no-sendable branch June 7, 2024 01:12
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.

Using a @preconcurrency conformance with non-Sendable arguments seems impossible
3 participants