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> {
233
233
// / Determine the kind of scope node we have.
234
234
ScopeKind getKind () const { return kind; }
235
235
236
- virtual NullablePtr<AbstractClosureExpr> getClosureIfClosureScope () const ;
237
236
ASTContext &getASTContext () const ;
238
237
NullablePtr<Decl> getDeclIfAny () const ;
239
238
NullablePtr<Stmt> getStmtIfAny () const ;
@@ -1161,9 +1160,6 @@ class ClosureParametersScope final : public ASTScopeImpl {
1161
1160
SourceRange
1162
1161
getSourceRangeOfThisASTNode (bool omitAssertions = false ) const override ;
1163
1162
1164
- NullablePtr<AbstractClosureExpr> getClosureIfClosureScope () const override {
1165
- return closureExpr;
1166
- }
1167
1163
Expr *getExpr () const { return closureExpr; }
1168
1164
bool ignoreInDebugInfo () const override { return true ; }
1169
1165
Original file line number Diff line number Diff line change @@ -98,10 +98,11 @@ Pattern *AbstractPatternEntryScope::getPattern() const {
98
98
}
99
99
100
100
NullablePtr<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
+ }
103
105
104
- NullablePtr<AbstractClosureExpr> ASTScopeImpl::getClosureIfClosureScope () const {
105
106
return nullptr ;
106
107
}
107
108
You can’t perform that action at this time.
0 commit comments