Skip to content

Commit 66459b8

Browse files
committed
Swift: use field in MethodApplyExpr
Also rename `getMethod` to `getMethodDeclaration` to clear up possible confusion with `getFunction`.
1 parent 6706ba6 commit 66459b8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

swift/ql/lib/codeql/swift/elements/expr/ApplyExpr.qll

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ class ApplyExpr extends ApplyExprBase {
3030
}
3131

3232
class MethodApplyExpr extends ApplyExpr {
33-
MethodApplyExpr() { this.getFunction() instanceof MethodRefExpr }
33+
private MethodRefExpr method;
3434

35-
AbstractFunctionDecl getMethod() { result = this.getFunction().(MethodRefExpr).getMethod() }
35+
MethodApplyExpr() { method = this.getFunction() }
3636

37-
override Expr getQualifier() { result = this.getFunction().(MethodRefExpr).getBase() }
37+
AbstractFunctionDecl getMethodDeclaration() { result = method.getMethod() }
38+
39+
override Expr getQualifier() { result = method.getBase() }
3840
}

0 commit comments

Comments
 (0)