Skip to content

[Concurrency] Fix try-await fix-it #36763

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
Apr 7, 2021

Conversation

etcwilde
Copy link
Contributor

@etcwilde etcwilde commented Apr 6, 2021

This patch fixes the order that the fix-it for try is emitted. It was prepending it to the call, but if an await is present, it should go before that instead. e.g try await foo() instead of await try foo().

Resolves: rdar://71058133

@etcwilde etcwilde requested review from kavon and DougGregor April 6, 2021 00:32
@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 6, 2021

@swift-ci please smoke test

@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 6, 2021

@swift-ci please smoke test macOS

Copy link
Member

@kavon kavon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 this is great. Thanks! Just had one suggestion.

etcwilde added 3 commits April 6, 2021 09:58
We want to be able to put the `try` before the `await`, so we need to
make it available where we emit the diagnostics and fix-its.
The easiest way to do that was through the context object.
Actually put the try fix-it before the await if it is available.
Updating the test to verify that we're putting the try fix-its in the
right place.
@etcwilde etcwilde force-pushed the ewilde/fix-try-await-fix-it branch from 9a6f067 to 45c81c2 Compare April 6, 2021 16:59
@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 6, 2021

@swift-ci please smoke test

1 similar comment
@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 6, 2021

@swift-ci please smoke test

@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 6, 2021

@swift-ci please smoke test windows

@etcwilde
Copy link
Contributor Author

etcwilde commented Apr 7, 2021

The Windows failure is an unrelated change that was made to lldb. compnerd and kastiglione have two PR’s with fixes that are racing each other. Compnerd’s is swiftlang/llvm-project#2808.
I’m going to merge now.

@etcwilde etcwilde merged commit 59a218a into swiftlang:main Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants