Skip to content

Commit c1e746a

Browse files
committed
Swift: add InitializerLookupExpr < MethodLookupExpr
1 parent 2af8ec8 commit c1e746a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
private import codeql.swift.elements.expr.MethodLookupExpr
2+
private import codeql.swift.elements.decl.ConstructorDecl
3+
4+
class InitializerLookupExpr extends MethodLookupExpr {
5+
InitializerLookupExpr() { super.getMethod() instanceof ConstructorDecl }
6+
7+
override ConstructorDecl getMethod() { result = super.getMethod() }
8+
9+
override string toString() { result = this.getMember().toString() }
10+
}

swift/ql/lib/swift.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import codeql.swift.elements
44
import codeql.swift.elements.expr.ArithmeticOperation
55
import codeql.swift.elements.expr.BitwiseOperation
66
import codeql.swift.elements.expr.LogicalOperation
7+
import codeql.swift.elements.expr.InitializerLookupExpr
78
import codeql.swift.elements.decl.MethodDecl
89
import codeql.swift.elements.decl.ClassOrStructDecl
910
import codeql.swift.Unit

0 commit comments

Comments
 (0)