Skip to content
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

[SR-14573] Convert call to async alternative not working if variable is used as completion handler #56925

Closed
ahoppen opened this issue May 3, 2021 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@ahoppen
Copy link
Contributor

ahoppen commented May 3, 2021

Previous ID SR-14573
Radar rdar://problem/77460524
Original Reporter @ahoppen
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, FoundByStressTester
Assignee @ahoppen
Priority Medium

md5: 56a4fd819ac29214ff9aa97c0542f5cd

Issue Description:

The Add async alternative refactoring reports itself as applicable but fails to do the refactoring if the completion handler is not a closure but a variable. The new test case below currently fails.

// RUN: %refactor -convert-call-to-async-alternative -dump-rewritten -source-filename %s -pos=6:6

func asyncAfter(execute work: () -> Void) {}

func delay(_ function: () -> Void) {
    asyncAfter(execute: function)
}
@ahoppen
Copy link
Contributor Author

ahoppen commented May 3, 2021

@swift-ci create

@ahoppen
Copy link
Contributor Author

ahoppen commented May 12, 2021

Fixed in #37314

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

1 participant