Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Apr 19, 2024

Previously we said a non-@Sendable local function was actor isolated if it captured an isolated parameter. The new rule no longer looks at captures, instead we force a capture of the isolated parameter if the function's parent context is actor isolated.

Instead of looking at captures, which wasn't sound with
recursive local functions; we would look at the captures of
the function currently being type checked, which are not
available yet.
If the outer context is actor isolated, we need to force a capture the
actor variable, since otherwise it might not appear in the capture list.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, lgtm :)

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

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