Skip to content

Commit 8b193a2

Browse files
committed
Also walk to Stmts and Decls, since those can contain Exprs
1 parent 548456d commit 8b193a2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Sema/MiscDiagnostics.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,6 +2027,16 @@ static void diagnoseImplicitSelfUseInClosure(const Expr *E,
20272027

20282028
return Action::Continue(E);
20292029
}
2030+
2031+
PreWalkResult<Stmt *> walkToStmtPre(Stmt *S) override {
2032+
// We need to look at all AST nodes, so make sure to check the children of statements
2033+
return Action::Continue(S);
2034+
}
2035+
2036+
PreWalkAction walkToDeclPre(Decl *D) override {
2037+
// We need to look at all AST nodes, so make sure to check the children of decls
2038+
return Action::Continue();
2039+
}
20302040
};
20312041

20322042
auto &ctx = DC->getASTContext();

0 commit comments

Comments
 (0)