File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,13 @@ class TypedPattern : public Pattern {
447447 return tp;
448448 }
449449
450+ static TypedPattern *createPropagated (ASTContext &ctx, Pattern *pattern,
451+ TypeRepr *typeRepr) {
452+ auto *TP = new (ctx) TypedPattern (pattern, typeRepr);
453+ TP->setPropagatedType ();
454+ return TP;
455+ }
456+
450457 // / True if the type in this \c TypedPattern was propagated from a different
451458 // / \c TypedPattern.
452459 // /
Original file line number Diff line number Diff line change @@ -8536,9 +8536,8 @@ Parser::parseDeclVar(ParseDeclOptions Flags,
85368536 Status.setIsParseError ();
85378537 }
85388538
8539- TypedPattern *NewTP = new (Context) TypedPattern (PrevPat,
8540- TP->getTypeRepr ());
8541- NewTP->setPropagatedType ();
8539+ auto *NewTP = TypedPattern::createPropagated (Context, PrevPat,
8540+ TP->getTypeRepr ());
85428541 PBDEntries[i-1 ].setPattern (NewTP);
85438542 }
85448543 }
You can’t perform that action at this time.
0 commit comments