[CSSimplify] Avoid eager matching between pack expansion and its contextual type

This is effectively a premature optimization. Contextual type might
not be fully resolved yet, so let's give solver a chance to do it for us.
This commit is contained in:
Pavel Yaskevich
2023-08-04 11:20:29 -07:00
parent 043d2aa3dd
commit 3dff3e5a49

View File

@@ -11619,17 +11619,6 @@ bool ConstraintSystem::resolvePackExpansion(TypeVariableType *typeVar,
.getOpenedType();
assignFixedType(typeVar, openedExpansionType, locator);
// We have a fully resolved contextual pack expansion type, let's
// apply it right away.
if (!contextualType->isEqual(openedExpansionType)) {
assert(contextualType->is<PackExpansionType>() &&
!contextualType->hasTypeVariable());
auto result = matchTypes(openedExpansionType, contextualType,
ConstraintKind::Equal, {}, locator);
return !result.isFailure();
}
return true;
}