@@ -444,6 +444,9 @@ enum class FixKind : uint8_t {
444444
445445 // / Allow value pack expansion without pack references.
446446 AllowValueExpansionWithoutPackReferences,
447+
448+ // / Ignore missing 'each' keyword before value pack reference.
449+ IgnoreMissingEachKeyword,
447450};
448451
449452class ConstraintFix {
@@ -3506,6 +3509,33 @@ class AllowValueExpansionWithoutPackReferences final : public ConstraintFix {
35063509 }
35073510};
35083511
3512+ class IgnoreMissingEachKeyword final : public ConstraintFix {
3513+ Type ValuePackType;
3514+
3515+ IgnoreMissingEachKeyword (ConstraintSystem &cs, Type valuePackTy,
3516+ ConstraintLocator *locator)
3517+ : ConstraintFix(cs, FixKind::IgnoreMissingEachKeyword, locator),
3518+ ValuePackType (valuePackTy) {}
3519+
3520+ public:
3521+ std::string getName () const override {
3522+ return " allow value pack reference without 'each'" ;
3523+ }
3524+
3525+ bool diagnose (const Solution &solution, bool asNote = false ) const override ;
3526+
3527+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
3528+ return diagnose (*commonFixes.front ().first );
3529+ }
3530+
3531+ static IgnoreMissingEachKeyword *
3532+ create (ConstraintSystem &cs, Type valuePackTy, ConstraintLocator *locator);
3533+
3534+ static bool classof (const ConstraintFix *fix) {
3535+ return fix->getKind () == FixKind::IgnoreMissingEachKeyword;
3536+ }
3537+ };
3538+
35093539} // end namespace constraints
35103540} // end namespace swift
35113541
0 commit comments