Skip to content

Update the 'Main Actor' section to clarify isolation for non-isolated functions#427

Open
ArtemAK wants to merge 1 commit into
swiftlang:mainfrom
ArtemAK:clarify-nonisolated-function-isolation
Open

Update the 'Main Actor' section to clarify isolation for non-isolated functions#427
ArtemAK wants to merge 1 commit into
swiftlang:mainfrom
ArtemAK:clarify-nonisolated-function-isolation

Conversation

@ArtemAK

@ArtemAK ArtemAK commented Dec 30, 2025

Copy link
Copy Markdown

This PR updates the 'Main Actor' section to correct a phrasing that implies functions inherit actor isolation from their callers.

In the current text, the use of 'because' suggests downloadPhoto runs off the main actor only because its caller is also off the main actor. This contradicts the principle of actor isolation and static isolation, where a function's isolation is determined by its own declaration.

I have updated the text to clarify that the execution context is determined by the callee's isolation domain and its isolation boundary, rather than being a side effect of the caller's state.

Clarify that functions do not inherit isolation from callers.
The current phrasing implies inheritance,
which contradicts actor isolation principles.
The update specifies that execution context is
determined by the callee's isolation domain and boundary
rather than being a side effect of the caller's state.
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