Skip to content

Commit 450b553

Browse files
committed
[CS] Remove UnresolvedType ranking logic
We should never end up here, we should have placeholder bindings instead for holes.
1 parent e52fd2a commit 450b553

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

lib/Sema/CSRanking.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,21 +1422,6 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
14221422
continue;
14231423
}
14241424

1425-
// With introduction of holes it's currently possible to form solutions
1426-
// with UnresolvedType bindings, we need to account for that in
1427-
// ranking. If one solution has a hole for a given type variable
1428-
// it's always worse than any non-hole type other solution might have.
1429-
if (type1->is<UnresolvedType>() || type2->is<UnresolvedType>()) {
1430-
if (type1->is<UnresolvedType>()) {
1431-
++score2;
1432-
} else {
1433-
++score1;
1434-
}
1435-
1436-
identical = false;
1437-
continue;
1438-
}
1439-
14401425
// If one type is a subtype of the other, but not vice-versa,
14411426
// we prefer the system with the more-constrained type.
14421427
// FIXME: Collapse this check into the second check.

lib/Sema/TypeOfReference.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,8 +1134,7 @@ static void bindArchetypesFromContext(
11341134
if (parentDC->isTypeContext()) {
11351135
if (parentDC != outerDC && parentDC->getSelfProtocolDecl()) {
11361136
auto selfTy = parentDC->getSelfInterfaceType();
1137-
auto contextTy = cs.getASTContext().TheUnresolvedType;
1138-
bindPrimaryArchetype(selfTy, contextTy);
1137+
bindPrimaryArchetype(selfTy, ErrorType::get(cs.getASTContext()));
11391138
}
11401139
continue;
11411140
}

0 commit comments

Comments
 (0)