@@ -181,19 +181,19 @@ deriveBodyEquatable_enum_hasAssociatedValues_eq(AbstractFunctionDecl *eqDecl,
181181 auto lhsSubpattern = DerivedConformance::enumElementPayloadSubpattern (elt, ' l' , eqDecl,
182182 lhsPayloadVars);
183183 auto *lhsBaseTE = TypeExpr::createImplicit (enumType, C);
184- auto lhsElemPat =
185- new (C) EnumElementPattern (lhsBaseTE, SourceLoc (), DeclNameLoc (),
186- DeclNameRef (), elt, lhsSubpattern);
184+ auto lhsElemPat = new (C)
185+ EnumElementPattern (lhsBaseTE, SourceLoc (), DeclNameLoc (), DeclNameRef (),
186+ elt, lhsSubpattern, /* DC */ eqDecl );
187187 lhsElemPat->setImplicit ();
188188
189189 // .<elt>(let r0, let r1, ...)
190190 SmallVector<VarDecl*, 3 > rhsPayloadVars;
191191 auto rhsSubpattern = DerivedConformance::enumElementPayloadSubpattern (elt, ' r' , eqDecl,
192192 rhsPayloadVars);
193193 auto *rhsBaseTE = TypeExpr::createImplicit (enumType, C);
194- auto rhsElemPat =
195- new (C) EnumElementPattern (rhsBaseTE, SourceLoc (), DeclNameLoc (),
196- DeclNameRef (), elt, rhsSubpattern);
194+ auto rhsElemPat = new (C)
195+ EnumElementPattern (rhsBaseTE, SourceLoc (), DeclNameLoc (), DeclNameRef (),
196+ elt, rhsSubpattern, /* DC */ eqDecl );
197197 rhsElemPat->setImplicit ();
198198
199199 auto hasBoundDecls = !lhsPayloadVars.empty ();
@@ -702,9 +702,10 @@ deriveBodyHashable_enum_hasAssociatedValues_hashInto(
702702
703703 auto payloadPattern = DerivedConformance::enumElementPayloadSubpattern (elt, ' a' , hashIntoDecl,
704704 payloadVars);
705- auto pat = new (C) EnumElementPattern (
706- TypeExpr::createImplicit (enumType, C), SourceLoc (), DeclNameLoc (),
707- DeclNameRef (elt->getBaseIdentifier ()), elt, payloadPattern);
705+ auto pat = new (C)
706+ EnumElementPattern (TypeExpr::createImplicit (enumType, C), SourceLoc (),
707+ DeclNameLoc (), DeclNameRef (elt->getBaseIdentifier ()),
708+ elt, payloadPattern, /* DC*/ hashIntoDecl);
708709 pat->setImplicit ();
709710
710711 auto labelItem = CaseLabelItem (pat);
0 commit comments