mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSSimplify] Make sure visit and record holes recursivelly for dependent member type
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user