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

[Concurrency][SE-0434] Treat globally-isolated local captured functions as Sendable. #73563

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simanerush
Copy link
Member

Fix a bug where global isolation was not checked for globally-isolated local function captures. Such functions should be treated as Sendable when captured.

Resolves #73562.

Notes:

  • Not sure why currently marking a local globally-isolated function @Sendable is not allowed. If that is not the intended behavior, I can also fix that here.
  • Ran into an issue where the isSendable() function on AnyFunctionType returned NotIsolated for an explicitly main-actor isolated local function, it would definitely be a nicer way to just use that function instead of checking for a presence of an attribute (as I currently do😵‍💫)
  • Test case is pending

…ndable`.

Fix a bug where global isolation was not checked for globally-isolated local function captures. Such functions should be treated as 'Sendable' when captured.
@simanerush
Copy link
Member Author

@swift-ci please test macos

@simanerush simanerush changed the title [Concurrency] Treat globally-isolated local captured functions as Sendable. [Concurrency][SE-0434] Treat globally-isolated local captured functions as Sendable. May 10, 2024
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.

[Concurrency][SE-0434] Treat captured local globally-isolated functions as Sendable
1 participant