Skip to content

[Concurrency] Don't strip @Sendable when determining the actor isolation of a closure in a @preconcurrency context. #72437

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

hborla
Copy link
Member

@hborla hborla commented Mar 19, 2024

Instead, downgrade any diagnostics about non-Sendable captures using the .limitBehaviorUntilSwiftVersion mechanism like other preconcurrency errors that are suppressed in minimal checking. Stripping @Sendable from closure types actually changes the isolation of the closure, because non-Sendable closures are isolated to the context they're formed in, which leads to bogus dynamic assertion failures under -enable-actor-data-race-checks.

Resolves: rdar://125033345

…ation

of a closure in a `@preconcurrency` context.

Instead, downgrade any diagnostics about non-`Sendable` captures using the
`.limitBehaviorUntilSwiftVersion` mechanism like other preconcurrency errors
that are suppressed in minimal checking. Stripping `@Sendable` from closure
types actually changes the isolation of the closure, because non-`Sendable`
closures are isolated to the context they're formed in, which leads to bogus
dynamic assertion failures under `-enable-actor-data-race-checks`.
@hborla
Copy link
Member Author

hborla commented Mar 19, 2024

@swift-ci please smoke test

@hborla hborla merged commit 9b41669 into swiftlang:main Mar 20, 2024
@hborla hborla deleted the sendable-closures-under-minimal-checking branch March 20, 2024 00:08
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