-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SR-2705][Sema] Always favor non-autoclosure parameter function overload on ranking #36076
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-2705][Sema] Always favor non-autoclosure parameter function overload on ranking #36076
Conversation
@swift-ci Please smoke test |
@swift-ci Please smoke test macOS platform |
@swift-ci Please smoke test Linux platform |
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.
I think CSRanking might be too big of a hammer here, how about we either increment an existing score kind i.e. SK_FunctionConversion
or add a new kind to use specifically for situations when closure is an argument for autoclosure coversion?
…losure context to avoid ambiguity
3724e44
to
1c86133
Compare
Thanks, I've updated and that indeed feels like a better solution :) |
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.
Definitely looks better now! I think we should add a new ScoreKind
at the end of the list though to make sure that it doesn’t interfere in ranking too much since SK_FunctionConversion
seems too high of a priority for this...
…ersion to increase impact of a function to autoclosure
That makes sense, changes done :) |
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.
I think we are almost there just need a couple of final changes to tests.
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.
Great work, thank you!
… correct overload
5046f27
to
419baee
Compare
@swift-ci Please smoke test |
@swift-ci please test source compatibility debug |
Thanks @xedin! |
Implement a rule on ranking where overload choices that has
@autoclosure
parameters are disfavored over the ones that aren't to avoid ambiguity in situations likeResolves SR-2705.