mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user