Skip to content

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

Merged
merged 3 commits into from
Oct 21, 2021

Conversation

DougGregor
Copy link
Member

When a closure is provided with a contextual type that has isolated
parameters, infer that the corresponding closure parameter is "isolated".

Fixes rdar://83732479.

When a closure is provided with a contextual type that has isolated
parameters, infer that the corresponding closure parameter is "isolated".

Fixes rdar://83732479.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member 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.

Curious why we prepare this for multiple isolated params, AFAIR we restrict to one nowadays -- just future proofing I guess?

@DougGregor
Copy link
Member Author

Windows failures is a Swift frontend crash in a test that shouldn't have mattered. Hmm. Trying again

@DougGregor
Copy link
Member Author

@swift-ci please test Windows

@DougGregor
Copy link
Member Author

Curious why we prepare this for multiple isolated params, AFAIR we restrict to one nowadays -- just future proofing I guess?

Yes, but also you could have multiple closures that have isolated parameters.

@@ -186,6 +186,8 @@ Solution ConstraintSystem::finalize() {

solution.solutionApplicationTargets = solutionApplicationTargets;
solution.caseLabelItems = caseLabelItems;
solution.isolatedParams.clear();
Copy link
Contributor

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.

Copy link
Member Author

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

@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit a11325c into swiftlang:main Oct 21, 2021
@DougGregor DougGregor deleted the infer-isolated-closure-parameters branch October 22, 2021 16:32
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.

4 participants