-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Infer 'isolated' closure parameters from context. #39850
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
Infer 'isolated' closure parameters from context. #39850
Conversation
When a closure is provided with a contextual type that has isolated parameters, infer that the corresponding closure parameter is "isolated". Fixes rdar://83732479.
@swift-ci please smoke test |
@swift-ci please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, LGTM.
Curious why we prepare this for multiple isolated params, AFAIR we restrict to one nowadays -- just future proofing I guess?
Windows failures is a Swift frontend crash in a test that shouldn't have mattered. Hmm. Trying again |
@swift-ci please test Windows |
Yes, but also you could have multiple closures that have isolated parameters. |
lib/Sema/CSSolver.cpp
Outdated
@@ -186,6 +186,8 @@ Solution ConstraintSystem::finalize() { | |||
|
|||
solution.solutionApplicationTargets = solutionApplicationTargets; | |||
solution.caseLabelItems = caseLabelItems; | |||
solution.isolatedParams.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I don't think we need a to clear here because it's a brand new solution allocated by finalize
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll drop it in a follow-up commit
@swift-ci please smoke test and merge |
When a closure is provided with a contextual type that has isolated
parameters, infer that the corresponding closure parameter is "isolated".
Fixes rdar://83732479.