Skip to content

[Concurrency] Fix an issue with Sendable checking for function references. #68420

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
Sep 10, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Sep 9, 2023

  • Add a test case for passing a non-Sendable argument to a nonisolated closure in an actor-isolated context. This previously did not produce a diagnostic, but now does on main.
  • Don't check parameter and result types of function references for Sendability. Sendability of function references depends only on captures, and applies when the function itself is passed across isolation boundaries. Parameter and result values can only cross isolation boundaries when the function is called, so they shouldn't be checked when checking a reference for Sendable violations.

Resolves rdar://104129168

nonisolated closure in an actor-isolated context.
…rences for

Sendability.

Sendability of function references depends only on captures, and applies when the
function itself is passed across isolation boundaries. Parameter and result
values can only cross isolation boundaries when the function is called.
@hborla
Copy link
Member Author

hborla commented Sep 9, 2023

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Sep 10, 2023

@swift-ci please smoke test Linux

@hborla hborla merged commit b5ddffd into swiftlang:main Sep 10, 2023
@hborla hborla deleted the async-closure-sendable-test branch September 10, 2023 19:32
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