File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1080,6 +1080,21 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
1080
1080
continue ;
1081
1081
}
1082
1082
1083
+ // With introduction of holes it's currently possible to form solutions
1084
+ // with UnresolvedType bindings, we need to account for that in
1085
+ // ranking. If one solution has a hole for a given type variable
1086
+ // it's always worse than any non-hole type other solution might have.
1087
+ if (type1->is <UnresolvedType>() || type2->is <UnresolvedType>()) {
1088
+ if (type1->is <UnresolvedType>()) {
1089
+ ++score2;
1090
+ } else {
1091
+ ++score1;
1092
+ }
1093
+
1094
+ identical = false ;
1095
+ continue ;
1096
+ }
1097
+
1083
1098
// If one type is a subtype of the other, but not vice-versa,
1084
1099
// we prefer the system with the more-constrained type.
1085
1100
// FIXME: Collapse this check into the second check.
You can’t perform that action at this time.
0 commit comments