@@ -438,6 +438,9 @@ enum class FixKind : uint8_t {
438438 // / Allow a pack expansion parameter of N elements to be matched
439439 // / with a single tuple literal argument of the same arity.
440440 DestructureTupleToMatchPackExpansionParameter,
441+
442+ // / Allow value pack expansion without pack references.
443+ AllowValueExpansionWithoutPackReferences,
441444};
442445
443446class ConstraintFix {
@@ -3453,6 +3456,31 @@ class DestructureTupleToMatchPackExpansionParameter final
34533456 }
34543457};
34553458
3459+ class AllowValueExpansionWithoutPackReferences final : public ConstraintFix {
3460+ AllowValueExpansionWithoutPackReferences (ConstraintSystem &cs,
3461+ ConstraintLocator *locator)
3462+ : ConstraintFix(cs, FixKind::AllowValueExpansionWithoutPackReferences,
3463+ locator) {}
3464+
3465+ public:
3466+ std::string getName () const override {
3467+ return " allow value pack expansion without pack references" ;
3468+ }
3469+
3470+ bool diagnose (const Solution &solution, bool asNote = false ) const override ;
3471+
3472+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
3473+ return diagnose (*commonFixes.front ().first );
3474+ }
3475+
3476+ static AllowValueExpansionWithoutPackReferences *
3477+ create (ConstraintSystem &cs, ConstraintLocator *locator);
3478+
3479+ static bool classof (const ConstraintFix *fix) {
3480+ return fix->getKind () == FixKind::AllowValueExpansionWithoutPackReferences;
3481+ }
3482+ };
3483+
34563484} // end namespace constraints
34573485} // end namespace swift
34583486
0 commit comments