Skip to content

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Sep 5, 2025

…sending)`

If there are no explicit concurrency attributes, isolated parameters, or captures associated with the closure it should infer nonisolated(nonsending) for the parent conversion injected by the solver (this conversion is injected because the solver cannot check captures to elide it).

The change pushes isIsolationInferenceBoundaryClosure check down with added benefit of getting preconcurrency context from the parent.

…sending)`

If there are no explicit concurrency attributes, isolated parameters,
or captures associated with the closure it should infer `nonisolated(nonsending)`
for the parent conversion injected by the solver (this conversion is injected
because the solver cannot check captures to elide it).

The change pushes `isIsolationInferenceBoundaryClosure` check down
with added benefit of getting preconcurrency context from the parent.
@xedin
Copy link
Contributor Author

xedin commented Sep 5, 2025

@swift-ci please test

// expected-error @-1 {{actor-isolated var 'number' cannot be passed 'inout' to 'async' function call}}
// expected-minimal-error @-2 {{global actor 'MyGlobalActor'-isolated var 'number' can not be used 'inout' from a nonisolated context}}
// expected-complete-error @-3 {{main actor-isolated var 'number' can not be used 'inout' from a nonisolated context}}
// expected-complete-warning @-3 {{main actor-isolated var 'number' can not be used 'inout' from a nonisolated context}}
Copy link
Contributor

@jamieQ jamieQ Sep 5, 2025

Choose a reason for hiding this comment

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

out of curiosity, why were the adjustments to these existing tests necessary (here & below)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mentioned that in the description:

The change pushes isIsolationInferenceBoundaryClosure check down with added benefit of getting preconcurrency context from the parent.

The check was preventing from preferring "preconcurrency" from parent context.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for elaborating!

@xedin
Copy link
Contributor Author

xedin commented Sep 9, 2025

@swift-ci please smoke test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Sep 10, 2025

@swift-ci please smoke test macOS platform

@xedin xedin merged commit ae9bae7 into swiftlang:main Sep 10, 2025
5 checks passed
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.

3 participants