11private import codeql.swift.generated.AstNode
2- private import codeql.swift.elements.decl.AbstractFunctionDecl
2+ private import codeql.swift.elements.decl.Function
33private import codeql.swift.elements.decl.Decl
4- private import codeql.swift.elements.expr.AbstractClosureExpr
4+ private import codeql.swift.elements.expr.ClosureExpr
55private import codeql.swift.elements.Callable
66private import codeql.swift.generated.ParentChild
77
@@ -15,12 +15,12 @@ private module Cached {
1515 Decl getEnclosingDecl ( AstNode ast ) { result = getEnclosingDeclStep * ( getImmediateParent ( ast ) ) }
1616
1717 private Element getEnclosingFunctionStep ( Element e ) {
18- not e instanceof AbstractFunctionDecl and
18+ not e instanceof Function and
1919 result = getEnclosingDecl ( e )
2020 }
2121
2222 cached
23- AbstractFunctionDecl getEnclosingFunction ( AstNode ast ) {
23+ Function getEnclosingFunction ( AstNode ast ) {
2424 result = getEnclosingFunctionStep * ( getEnclosingDecl ( ast ) )
2525 }
2626
@@ -30,7 +30,7 @@ private module Cached {
3030 }
3131
3232 cached
33- AbstractClosureExpr getEnclosingClosure ( AstNode ast ) {
33+ ClosureExpr getEnclosingClosure ( AstNode ast ) {
3434 result = getEnclosingClosureStep * ( getImmediateParent ( ast ) )
3535 }
3636}
@@ -53,7 +53,7 @@ class AstNode extends Generated::AstNode {
5353 * }
5454 * ```
5555 */
56- final AbstractFunctionDecl getEnclosingFunction ( ) { result = Cached:: getEnclosingFunction ( this ) }
56+ final Function getEnclosingFunction ( ) { result = Cached:: getEnclosingFunction ( this ) }
5757
5858 /**
5959 * Gets the nearest declaration that contains this AST node, if any.
0 commit comments