[ConstraintSystem] Handle presence of pack expansion type variables while matching

This commit is contained in:
Pavel Yaskevich
2023-04-10 09:40:46 -07:00
committed by Pavel Yaskevich
parent c7ef47df0e
commit ca534ef60a
2 changed files with 23 additions and 25 deletions

View File

@@ -3784,7 +3784,9 @@ struct TypeSimplifier {
// Flatten single-element tuples containing type variables that cannot
// bind to packs.
auto typeVar = elementType->getAs<TypeVariableType>();
if (!element.hasName() && typeVar && !typeVar->getImpl().canBindToPack()) {
if (!element.hasName() && typeVar &&
!typeVar->getImpl().canBindToPack() &&
!typeVar->getImpl().isPackExpansion()) {
return typeVar;
}
}