Skip to content

[IDE] Skip synthesized curry thunks and walk their unwrapped expression #38712

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 1 commit into from
Aug 2, 2021

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Jul 31, 2021

SemaAnnotator was walking into an autoclosure and then manually running
passReference on the unwrapped expression without walking it. Since
its synthesized anyway, skip walking the autoclosure entirely and walk
the unwrapped expression instead.

Fix swift::ide::isBeingCalled to look through IdentityExprs and
swift::ide::getBase also not unwrapping curry thunks.

Resolves rdar://81312849

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 2d0ad1a77442289d3ef25e6fc9c521b85f20592b

SemaAnnotator was walking into an autoclosure and then manually running
`passReference` on the unwrapped expression without walking it. Since
its synthesized anyway, skip walking the autoclosure entirely and walk
the unwrapped expression instead.

Fix `swift::ide::isBeingCalled` to look through `IdentityExpr`s and
`swift::ide::getBase` also not unwrapping curry thunks.

Resolves rdar://81312849
@bnbarham
Copy link
Contributor Author

Thanks for the quick review @slavapestov. Turns out the migrator was depending on getReferencedDecl not grabbing the semantic expression. I added a bool param to it (semantic) that's true by default, since it seems to make sense in the other places its used (which is only code completion and isBeingCalled).

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 15c7ddd

@bnbarham
Copy link
Contributor Author

@swift-ci please test Linux platform

@bnbarham
Copy link
Contributor Author

@swift-ci please test Windows platform

@bnbarham bnbarham merged commit aeb36ab into main Aug 2, 2021
@bnbarham bnbarham deleted the missing-roles branch August 2, 2021 22:45
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.

4 participants