@@ -7282,22 +7282,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
72827282 }
72837283 }
72847284
7285- // Matching types where one side is a pack expansion and the other is not
7286- // means a pack expansion was used where it isn't supported.
7287- if (type1->is<PackExpansionType>() != type2->is<PackExpansionType>()) {
7288- if (!shouldAttemptFixes())
7289- return getTypeMatchFailure(locator);
7290-
7291- if (type1->isPlaceholder() || type2->isPlaceholder())
7292- return getTypeMatchSuccess();
7293-
7294- auto *loc = getConstraintLocator(locator);
7295- if (recordFix(AllowInvalidPackExpansion::create(*this, loc)))
7296- return getTypeMatchFailure(locator);
7297-
7298- return getTypeMatchSuccess();
7299- }
7300-
73017285 if (kind >= ConstraintKind::Conversion) {
73027286 // An lvalue of type T1 can be converted to a value of type T2 so long as
73037287 // T1 is convertible to T2 (by loading the value). Note that we cannot get
@@ -7720,6 +7704,22 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
77207704 }
77217705 }
77227706
7707+ // Matching types where one side is a pack expansion and the other is not
7708+ // means a pack expansion was used where it isn't supported.
7709+ if (type1->is<PackExpansionType>() != type2->is<PackExpansionType>()) {
7710+ if (!shouldAttemptFixes())
7711+ return getTypeMatchFailure(locator);
7712+
7713+ if (type1->isPlaceholder() || type2->isPlaceholder())
7714+ return getTypeMatchSuccess();
7715+
7716+ auto *loc = getConstraintLocator(locator);
7717+ if (recordFix(AllowInvalidPackExpansion::create(*this, loc)))
7718+ return getTypeMatchFailure(locator);
7719+
7720+ return getTypeMatchSuccess();
7721+ }
7722+
77237723 // Attempt fixes iff it's allowed, both types are concrete and
77247724 // we are not in the middle of attempting one already.
77257725 if (shouldAttemptFixes() && !flags.contains(TMF_ApplyingFix)) {
0 commit comments