Skip to content

[5.5][Refactoring] Fix invalid legacy body for Result<Void, ...> handler #38865

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
Aug 16, 2021

Conversation

bnbarham
Copy link
Contributor

Cherry-picks #38665 and #38855

ahoppen and others added 3 commits August 13, 2021 09:17
…eed to be unwrapped after refactoring

Throw another `getSemanticsProvidingExpr` in the async refactoring code for better results.
When adding an async alternative for a function with a
`(Result<Void, ...>) -> Void` completion handler, the legacy body was
adding a call to the handler with `.success(result)`. We don't assign to
`result` for `Void` handlers, so pass `()` instead.

Resolves rdar://81829392
Update the async refactoring tests in `convert_function.swift` to
compile the refactored code (where possible) to check for errors. This
would have prevented the issue with the refactored `Result<Void, ...`>
handler producing erroneous code.
@bnbarham bnbarham requested a review from a team as a code owner August 13, 2021 01:34
@bnbarham bnbarham requested a review from akyrtzi August 13, 2021 01:34
@bnbarham bnbarham added the r5.5 label Aug 13, 2021
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham merged commit 20a4c14 into release/5.5 Aug 16, 2021
@bnbarham bnbarham deleted the cherry-rdar81829392 branch August 16, 2021 23:52
@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.

4 participants