-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CodeCompletion][Sema] Refine logic that ignores missing arguments after the code completion position when solving #35136
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
Conversation
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I have left a couple of comments inline.
1ca0d69
to
c9fe157
Compare
@swift-ci please test |
c9fe157
to
eefdce5
Compare
@swift-ci please test |
…ter the code completion position when solving If the completion loc was in a trailing closure arg, it only makes sense to ignore later missing args if they have function type, as there's no way for the user to complete the call for overload being matched otherwise. Also fix a bug where we were incorrectly penalizing solutions with holes that were ultimately due to missing arguments after the completion position. Resolves rdar://problem/72412302
eefdce5
to
cdcaa11
Compare
@swift-ci please test and merge |
@swift-ci please test and merge |
If the completion loc was in a trailing closure arg, it only makes sense to ignore later missing args if they can accept a closure argument (e.g. function type,
Any
, or generics), as there's no way for the user to complete the call for the overload being matched otherwise.This also fix a bug where we were incorrectly penalizing solutions with holes that were ultimately due to missing arguments after the completion position (e.g. if the missing argument corresponded to a generic parameter), and ended up excluding those solutions from the results.
Resolves rdar://problem/72412302