Skip to content

Commit 91f35a5

Browse files
committed
Swift: isStaticOrClassMethod + isInstanceMethod
Still, we should really be extracting these attributes.
1 parent 6a0b020 commit 91f35a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

swift/ql/lib/codeql/swift/elements/decl/MethodDecl.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,10 @@ class MethodDecl extends AbstractFunctionDecl {
5858
/**
5959
* Holds if this function is a `static` or `class` method, as opposed to an instance method.
6060
*/
61-
predicate isStatic() { this.getSelfParam().getType() instanceof MetatypeType }
61+
predicate isStaticOrClassMethod() { this.getSelfParam().getType() instanceof MetatypeType }
62+
63+
/**
64+
* Holds if this function is an instance method, as opposed to a `static` or `class` method.
65+
*/
66+
predicate isInstanceMethod() { not this.isStaticOrClassMethod() }
6267
}

0 commit comments

Comments
 (0)