[ConstraintSystem] Prefer overloads choices that are variables over unapplied functions using the solver score.#39390
Merged
hborla merged 2 commits intoswiftlang:mainfrom Sep 24, 2021
Conversation
hborla
commented
Sep 22, 2021
Member
Author
There was a problem hiding this comment.
If anybody knows of other count(where:) test cases, please let me know and I'll add them to this file!
for unapplied references when the choice is a function declaration. This will allow the solver to prune those overload choices when it has already found a solultion with a property (all else equal in the score). This is already done as an ambiguity tie-breaker in solution ranking, but adding this bit to the score will prune a lot of search space within the solver.
0a0f91a to
2032da0
Compare
Member
Author
|
@swift-ci please test source compatibility |
Member
Author
|
@swift-ci please smoke test compiler performance |
Member
Author
|
@swift-ci please test compiler performance |
xedin
approved these changes
Sep 22, 2021
Contributor
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Source compatibility failures are unrelated (and also failing on |
Member
Author
|
@swift-ci please smoke test |
Member
Author
|
@swift-ci please test Windows platform |
1 similar comment
Member
Author
|
@swift-ci please test Windows platform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change increases the score when the solver attempts an overload choice that is an unapplied reference to a function declaration. This will allows the solver to prune those overload choices when it has already found a solution with a property (all else equal in the score). This is already done as an ambiguity tie-breaker in solution ranking, but adding this bit to the score will prune a lot of search space within the solver.
This should fix many of the type checker performance issues that were observed with the addition of
count(where:), including usingarray.countin operator expressions.Resolves: rdar://47742750