Skip to content

Commit 2af8ec8

Browse files
committed
Swift: init/deinit stringifies with qualifier
1 parent 14b84c6 commit 2af8ec8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ private import codeql.swift.elements.decl.MethodDecl
44
/**
55
* An initializer of a class, struct, enum or protocol.
66
*/
7-
class ConstructorDecl extends Generated::ConstructorDecl, MethodDecl { }
7+
class ConstructorDecl extends Generated::ConstructorDecl, MethodDecl {
8+
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
9+
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ private import codeql.swift.elements.decl.MethodDecl
44
/**
55
* A deinitializer of a class.
66
*/
7-
class DestructorDecl extends Generated::DestructorDecl, MethodDecl { }
7+
class DestructorDecl extends Generated::DestructorDecl, MethodDecl {
8+
override string toString() { result = this.getSelfParam().getType() + "." + super.toString() }
9+
}

0 commit comments

Comments
 (0)