Skip to content

[5.5][Refactoring] When adding an async alternative refactor the old method to call the async method using detach #37203

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

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 1, 2021

Cherry-picks #37185 to 5.5.


Instead of leaving two copies of the same implementation, rewrite the old method with the completion handler to call the newly added async method.

Also add a tool %refactor-check-compiles which is a drop-in replacement for %refactor and verifies that the refactored code actually compiles.

Resolves rdar://74464833

@ahoppen ahoppen requested review from akyrtzi and bnbarham May 1, 2021 06:13
@ahoppen ahoppen added the r5.5 label May 1, 2021
@ahoppen ahoppen changed the title [Refactoring] When adding an async alternative refactor the old method to call the async method using detach [5.5][Refactoring] When adding an async alternative refactor the old method to call the async method using detach May 1, 2021
@ahoppen ahoppen force-pushed the pr-5.5/legacy-async-method-refactor branch from ee2b81e to be85d81 Compare May 3, 2021 15:48
ahoppen added 2 commits May 4, 2021 12:07
…d to call the async method using detach

Instead of leaving two copies of the same implementation, rewrite the old method with the completion handler to call the newly added `async` method.

Resolves rdar://74464833
@ahoppen ahoppen force-pushed the pr-5.5/legacy-async-method-refactor branch from be85d81 to 2878ab4 Compare May 4, 2021 10:07
@ahoppen ahoppen requested a review from a team as a code owner May 4, 2021 10:07
@ahoppen
Copy link
Member Author

ahoppen commented May 4, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2021

Build failed
Swift Test OS X Platform
Git Sha - 2878ab4

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2021

Build failed
Swift Test Linux Platform
Git Sha - 2878ab4

In `main` this method was added by 9ed732f. Since that commit is rather large, only cherry-pick the `isOptional` method to 5.5.
@ahoppen
Copy link
Member Author

ahoppen commented May 4, 2021

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2021

Build failed
Swift Test OS X Platform
Git Sha - fc23339

@ahoppen
Copy link
Member Author

ahoppen commented May 5, 2021

@swift-ci Please test macOS

@ahoppen ahoppen merged commit 3a2015f into swiftlang:release/5.5 May 6, 2021
@ahoppen ahoppen deleted the pr-5.5/legacy-async-method-refactor branch May 6, 2021 16:35
@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