[CSSimplify] Make sure visit and record holes recursivelly for dependent member type

This commit is contained in:
Luciano Almeida
2020-10-16 18:32:20 -03:00
parent 23605e1363
commit 883d583a2f
2 changed files with 6 additions and 12 deletions

View File

@@ -9913,16 +9913,11 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
return false;
}
void ConstraintSystem::recordPotentialHole(TypeVariableType *typeVar) {
assert(typeVar);
typeVar->getImpl().enableCanBindToHole(getSavedBindings());
}
void ConstraintSystem::recordPotentialHole(FunctionType *fnType) {
assert(fnType);
Type(fnType).visit([&](Type type) {
void ConstraintSystem::recordPotentialHole(Type type) {
assert(type->hasTypeVariable());
type.visit([&](Type type) {
if (auto *typeVar = type->getAs<TypeVariableType>())
recordPotentialHole(typeVar);
typeVar->getImpl().enableCanBindToHole(getSavedBindings());
});
}
@@ -10024,7 +10019,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
newTupleTypes.push_back(smallerElt);
} else {
if (largerElt.getType()->isTypeVariableOrMember())
recordPotentialHole(largerElt.getType()->getAs<TypeVariableType>());
recordPotentialHole(largerElt.getType());
}
}
auto matchingType =