File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,6 @@ class ASTScopeImpl : public ASTAllocated<ASTScopeImpl> {
233233 // / Determine the kind of scope node we have.
234234 ScopeKind getKind () const { return kind; }
235235
236- virtual NullablePtr<AbstractClosureExpr> getClosureIfClosureScope () const ;
237236 ASTContext &getASTContext () const ;
238237 NullablePtr<Decl> getDeclIfAny () const ;
239238 NullablePtr<Stmt> getStmtIfAny () const ;
@@ -1161,9 +1160,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
11611160 SourceRange
11621161 getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
11631162
1164- NullablePtr<AbstractClosureExpr> getClosureIfClosureScope () const override {
1165- return closureExpr;
1166- }
11671163 Expr *getExpr () const { return closureExpr; }
11681164 bool ignoreInDebugInfo () const override { return true ; }
11691165
Original file line number Diff line number Diff line change @@ -98,10 +98,11 @@ Pattern *AbstractPatternEntryScope::getPattern() const {
9898}
9999
100100NullablePtr<AbstractClosureExpr> BraceStmtScope::parentClosureIfAny () const {
101- return !getParent () ? nullptr : getParent ().get ()->getClosureIfClosureScope ();
102- }
101+ if (auto parent = getParent ()) {
102+ if (auto closureScope = dyn_cast<ClosureParametersScope>(parent.get ()))
103+ return closureScope->closureExpr ;
104+ }
103105
104- NullablePtr<AbstractClosureExpr> ASTScopeImpl::getClosureIfClosureScope () const {
105106 return nullptr ;
106107}
107108
You can’t perform that action at this time.
0 commit comments