@@ -26,8 +26,8 @@ class MethodDecl extends AbstractFunctionDecl {
2626 }
2727
2828 /**
29- * Holds if this function is called `funcName` and its a member of a
30- * class, struct, extension, enum or protocol call `typeName`.
29+ * Holds if this function is called `funcName` and is a member of a
30+ * class, struct, extension, enum or protocol called `typeName`.
3131 */
3232 cached
3333 predicate hasQualifiedName ( string typeName , string funcName ) {
@@ -46,12 +46,17 @@ class MethodDecl extends AbstractFunctionDecl {
4646 }
4747
4848 /**
49- * Holds if this function is called `funcName` and its a member of a
50- * class, struct, extension, enum or protocol call `typeName` in a module
49+ * Holds if this function is called `funcName` and is a member of a
50+ * class, struct, extension, enum or protocol called `typeName` in a module
5151 * called `moduleName`.
5252 */
5353 predicate hasQualifiedName ( string moduleName , string typeName , string funcName ) {
5454 this .hasQualifiedName ( typeName , funcName ) and
5555 this .getModule ( ) .getFullName ( ) = moduleName
5656 }
57+
58+ /**
59+ * Holds if this function is a `static` or `class` method, as opposed to an instance method.
60+ */
61+ predicate isStatic ( ) { this .getSelfParam ( ) .getType ( ) instanceof MetatypeType }
5762}
0 commit comments