Skip to content

Commit 515e935

Browse files
committed
Swift: Make ExtensionDecl.toString robust to when there's more than one extended thing.
1 parent 931b27f commit 515e935

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ private import codeql.swift.generated.decl.ExtensionDecl
22

33
class ExtensionDecl extends Generated::ExtensionDecl {
44
override string toString() {
5-
result = "extension of " + this.getExtendedTypeDecl().toString()
5+
result =
6+
"extension of " + unique(NominalTypeDecl td | td = this.getExtendedTypeDecl()).toString()
67
or
7-
not exists(this.getExtendedTypeDecl()) and
8+
count(this.getExtendedTypeDecl()) != 1 and
89
result = "extension"
910
}
1011
}

0 commit comments

Comments
 (0)