File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -202,6 +202,9 @@ class alignas(8) Pattern {
202202 // / Does this binding declare something that requires storage?
203203 bool hasStorage () const ;
204204
205+ // / Does this pattern have any mutable 'var' bindings?
206+ bool hasAnyMutableBindings () const ;
207+
205208 static bool classof (const Pattern *P) { return true ; }
206209
207210 // *** Allocation Routines ************************************************/
Original file line number Diff line number Diff line change @@ -291,6 +291,15 @@ bool Pattern::hasStorage() const {
291291 return HasStorage;
292292}
293293
294+ bool Pattern::hasAnyMutableBindings () const {
295+ auto HasMutable = false ;
296+ forEachVariable ([&](VarDecl *VD) {
297+ if (!VD->isLet ())
298+ HasMutable = true ;
299+ });
300+ return HasMutable;
301+ }
302+
294303// / Return true if this is a non-resolved ExprPattern which is syntactically
295304// / irrefutable.
296305static bool isIrrefutableExprPattern (const ExprPattern *EP) {
You can’t perform that action at this time.
0 commit comments