Skip to content

Commit c2ad27c

Browse files
authored
Merge pull request swiftlang#62899 from xedin/closure-analyzer-shouldnt-walk-local-decls
[CSGen] Closure analyzer shouldn't walk into local some decls/patterns
2 parents c7cde3a + ca126bc commit c2ad27c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Sema/CSGen.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,6 +2942,14 @@ namespace {
29422942

29432943
return Action::Continue(expr);
29442944
}
2945+
2946+
PreWalkAction walkToDeclPre(Decl *D) override {
2947+
return Action::VisitChildrenIf(isa<PatternBindingDecl>(D));
2948+
}
2949+
2950+
PreWalkResult<Pattern *> walkToPatternPre(Pattern *P) override {
2951+
return Action::SkipChildren(P);
2952+
}
29452953
} collectVarRefs(CS);
29462954

29472955
closure->walk(collectVarRefs);

0 commit comments

Comments
 (0)