File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
codeql/swift/elements/decl Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ private import swift
2
+
3
+ private Decl getAMember ( IterableDeclContext ctx ) {
4
+ ctx .getAMember ( ) = result
5
+ or
6
+ exists ( VarDecl var |
7
+ ctx .getAMember ( ) = var and
8
+ var .getAnAccessorDecl ( ) = result
9
+ )
10
+ }
11
+
12
+ class MethodDecl extends AbstractFunctionDecl {
13
+ MethodDecl ( ) {
14
+ this = getAMember ( any ( ClassDecl c ) )
15
+ or
16
+ this = getAMember ( any ( StructDecl c ) )
17
+ or
18
+ this = getAMember ( any ( ExtensionDecl c ) )
19
+ or
20
+ this = getAMember ( any ( EnumDecl c ) )
21
+ or
22
+ this = getAMember ( any ( ProtocolDecl c ) )
23
+ }
24
+ }
Original file line number Diff line number Diff line change 2
2
3
3
import codeql.swift.elements
4
4
import codeql.swift.elements.expr.LogicalOperation
5
+ import codeql.swift.elements.decl.MethodDecl
You can’t perform that action at this time.
0 commit comments