We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71e8148 commit 7e07644Copy full SHA for 7e07644
lib/Sema/CSRanking.cpp
@@ -876,6 +876,20 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
876
continue;
877
}
878
879
+ // Dynamic member lookup through a keypath is better than one using string
880
+ // because it carries more type information.
881
+ if (choice1.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup &&
882
+ choice2.getKind() == OverloadChoiceKind::DynamicMemberLookup) {
883
+ score1 += weight;
884
+ continue;
885
+ }
886
+
887
+ if (choice1.getKind() == OverloadChoiceKind::DynamicMemberLookup &&
888
+ choice2.getKind() == OverloadChoiceKind::KeyPathDynamicMemberLookup) {
889
+ score2 += weight;
890
891
892
893
894
895
0 commit comments