Skip to content

Commit 224bc93

Browse files
committed
Swift: Fix ConditionElement.toString().
1 parent 13c7c84 commit 224bc93

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

swift/ql/lib/codeql/swift/elements/stmt/ConditionElement.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ class ConditionElement extends Generated::ConditionElement {
66
result = this.getBoolean().toString()
77
or
88
result = this.getPattern().toString() + " = ... "
9+
or
10+
result = this.getAvailability().toString()
911
}
1012
}

swift/ql/test/library-tests/ast/PrintAst.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5898,7 +5898,7 @@ statements.swift:
58985898
# 87| getBody(): [BraceStmt] { ... }
58995899
# 87| getElement(0): [IfStmt] if ... then { ... }
59005900
# 87| getCondition(): [StmtCondition] StmtCondition
5901-
# 87| getElement(0): (no string representation)
5901+
# 87| getElement(0): [ConditionElement] #available
59025902
# 87| getAvailability(): [AvailabilityInfo] #available
59035903
# 87| getSpec(0): [PlatformVersionAvailabilitySpec] macOS 155
59045904
# 87| getSpec(1): [OtherAvailabilitySpec] *
@@ -5918,7 +5918,7 @@ statements.swift:
59185918
# 91| getBody(): [BraceStmt] { ... }
59195919
# 91| getElement(0): [IfStmt] if ... then { ... }
59205920
# 91| getCondition(): [StmtCondition] StmtCondition
5921-
# 91| getElement(0): (no string representation)
5921+
# 91| getElement(0): [ConditionElement] #unavailable
59225922
# 91| getAvailability(): [AvailabilityInfo] #unavailable
59235923
# 91| getSpec(0): [PlatformVersionAvailabilitySpec] macOS 42
59245924
# 91| getThen(): [BraceStmt] { ... }

0 commit comments

Comments
 (0)