mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] implement implicit pack materialization for abstract tuples instead of explicit '.element'
This commit is contained in:
@@ -3614,9 +3614,8 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
// In the future, _if_ the syntax allows for multiple expansions
|
||||
// this code would have to be adjusted to project l-value from the
|
||||
// base type just like TupleIndex does.
|
||||
auto tuple = choice.getBaseType()->getRValueType()->castTo<TupleType>();
|
||||
auto *expansion = tuple->getElementType(0)->castTo<PackExpansionType>();
|
||||
adjustedRefType = expansion->getPatternType();
|
||||
adjustedRefType =
|
||||
getPatternTypeOfSingleUnlabeledPackExpansionTuple(choice.getBaseType());
|
||||
refType = adjustedRefType;
|
||||
break;
|
||||
}
|
||||
@@ -3873,7 +3872,8 @@ struct TypeSimplifier {
|
||||
if (typeVar->getImpl().isPackExpansion() &&
|
||||
!resolvedType->isEqual(typeVar) &&
|
||||
!resolvedType->is<PackExpansionType>() &&
|
||||
!resolvedType->is<PackType>()) {
|
||||
!resolvedType->is<PackType>() &&
|
||||
!resolvedType->is<PackArchetypeType>()) {
|
||||
return resolvedType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user