mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[AST] Remove ReifyPackExpr.
This commit is contained in:
@@ -6834,15 +6834,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A Pack of (Ts...) is convertible to a tuple (X, Y, Z) as long as there
|
||||
// is an element-wise match.
|
||||
if (auto *expansionTy = type1->getAs<PackType>()) {
|
||||
if (!type2->isTypeVariableOrMember()) {
|
||||
conversionsOrFixes.push_back(
|
||||
ConversionRestrictionKind::ReifyPackToType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (kind >= ConstraintKind::OperatorArgumentConversion) {
|
||||
@@ -12679,22 +12670,6 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
|
||||
{getConstraintLocator(locator), restriction});
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
case ConversionRestrictionKind::ReifyPackToType: {
|
||||
type1 = simplifyType(type1);
|
||||
auto *PET = type1->castTo<PackType>();
|
||||
if (auto *TT = type2->getAs<TupleType>()) {
|
||||
llvm::SmallVector<TupleTypeElt, 8> elts;
|
||||
for (Type elt : PET->getElementTypes()) {
|
||||
elts.push_back(elt);
|
||||
}
|
||||
Type tupleType1 = TupleType::get(elts, getASTContext());
|
||||
return matchTypes(tupleType1, TT, ConstraintKind::Bind, subflags,
|
||||
locator);
|
||||
} else {
|
||||
return matchTypes(PET->getElementType(0), type2, ConstraintKind::Bind,
|
||||
subflags, locator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
llvm_unreachable("bad conversion restriction");
|
||||
|
||||
Reference in New Issue
Block a user