Skip to content

[Refactoring] Only unwrap optionals if the handler has an optional error #37297

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 2 commits into from
May 7, 2021

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented May 6, 2021

Cherry-picks #37235

Resolves rdar://73973459

bnbarham added 2 commits May 7, 2021 08:21
Convert to async and add async alternative differ when there is no/an
invalid completion handler. In those cases, also check convert to async.
@bnbarham bnbarham added the r5.5 label May 6, 2021
@bnbarham bnbarham requested a review from akyrtzi May 6, 2021 22:24
@bnbarham bnbarham requested a review from a team as a code owner May 6, 2021 22:24
@bnbarham
Copy link
Contributor Author

bnbarham commented May 6, 2021

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented May 7, 2021

@swift-ci please nominate

--- CCC ---

Explanation: Fixes the async refactoring to properly handle mixed optional/non-optional parameters, only unwrapping them if the last parameter in the completion handler is an optional error.

Radar/SR Issue: rdar://73973459

Risk: Low. Only affects the async refactoring, which has added tests for this case.

Testing: Added new tests for functions with mixed optional/non-optional args.

@akyrtzi akyrtzi merged commit 56347d1 into swiftlang:release/5.5 May 7, 2021
@bnbarham bnbarham deleted the cherry-rdar73973459 branch May 7, 2021 03:13
@AnthonyLatsis AnthonyLatsis added swift 5.5 🍒 release cherry pick Flag: Release branch cherry picks 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