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 {
202
202
// / Does this binding declare something that requires storage?
203
203
bool hasStorage () const ;
204
204
205
+ // / Does this pattern have any mutable 'var' bindings?
206
+ bool hasAnyMutableBindings () const ;
207
+
205
208
static bool classof (const Pattern *P) { return true ; }
206
209
207
210
// *** Allocation Routines ************************************************/
Original file line number Diff line number Diff line change @@ -291,6 +291,15 @@ bool Pattern::hasStorage() const {
291
291
return HasStorage;
292
292
}
293
293
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
+
294
303
// / Return true if this is a non-resolved ExprPattern which is syntactically
295
304
// / irrefutable.
296
305
static bool isIrrefutableExprPattern (const ExprPattern *EP) {
You can’t perform that action at this time.
0 commit comments