[Diagnostics] Don't fail simplifyFixConstraint for tuples of pack expansion types.

This commit is contained in:
Holly Borla
2023-01-05 19:54:17 -08:00
parent c363fa2510
commit 319ae65636
2 changed files with 78 additions and 21 deletions

View File

@@ -13795,11 +13795,15 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
auto smaller = lhsLarger ? rhs : lhs;
llvm::SmallVector<TupleTypeElt, 4> newTupleTypes;
// FIXME: For now, if either side contains pack expansion types, just fail.
// FIXME: For now, if either side contains pack expansion types, consider
// the fix constraint solved without trying to figure out which tuple
// elements were part of the pack.
{
if (lhs->containsPackExpansionType() ||
rhs->containsPackExpansionType()) {
return SolutionKind::Error;
if (recordFix(fix))
return SolutionKind::Error;
return SolutionKind::Solved;
}
}