Skip to content

[5.5] [Async Refactoring] Better handle bool flag parameter bindings #39225

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 4 commits into from
Sep 9, 2021

Conversation

hamishknight
Copy link
Contributor

5.5 cherry-pick of #39159


If we have a known bool flag parameter, drop it from the success parameters being bound in a refactored await call, as the async variant drops it. And in the fallback case, add a binding for it in the success and error block.

rdar://81896460

Refactor some closure parameter handling logic
into a new ClosureCallbackParams type, which lets
us clean up some of the parameters passed to
CallbackClassifier, and better distinguish between
an error param and a Result param.
If we have a known bool flag parameter, drop it
from the success parameters being bound in a
refactored await call, as the async variant drops
it.

rdar://81896460
Make sure to convert any references to parameters
that get dropped in the fallback case to
placeholders.
Generalize the logic to handle different BlockKinds,
and add binding logic that lets us assign `true` or
`false` to the given bool success param in the
fallback case.
@hamishknight hamishknight requested a review from akyrtzi September 9, 2021 11:23
@hamishknight hamishknight requested a review from a team as a code owner September 9, 2021 11:23
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@akyrtzi akyrtzi merged commit 06ef083 into swiftlang:release/5.5 Sep 9, 2021
@hamishknight hamishknight deleted the conditions-apply-5.5 branch September 9, 2021 17:46
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.5 labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants