Skip to content

Commit 57abd4a

Browse files
authored
Merge pull request #9612 from MathiasVP/fix-other-constructor-decl-ref-expr-to-string
Swift: Fix 'toString' on 'OtherConstructorDeclRefExpr'
2 parents af379da + 12d27ec commit 57abd4a

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
private import codeql.swift.generated.expr.OtherConstructorDeclRefExpr
22

33
class OtherConstructorDeclRefExpr extends OtherConstructorDeclRefExprBase {
4-
override string toString() {
5-
result = "call to ..." // TODO: We can make this better once we extract the constructor call
6-
}
4+
override string toString() { result = this.getConstructorDecl().toString() }
75
}

swift/ql/test/extractor-tests/expressions/all.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
| expressions.swift:79:5:79:11 | call to ... |
161161
| expressions.swift:79:5:79:21 | call to ... |
162162
| expressions.swift:79:5:79:21 | self = ... |
163-
| expressions.swift:79:11:79:11 | call to ... |
163+
| expressions.swift:79:11:79:11 | init |
164164
| expressions.swift:79:19:79:19 | 22 |
165165
| expressions.swift:83:15:83:15 | Derived.Type |
166166
| expressions.swift:83:15:83:15 | call to ... |

swift/ql/test/library-tests/controlflow/graph/Cfg.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,7 +4895,7 @@ cfg.swift:
48954895
#-----| -> exit init
48964896

48974897
# 378| init
4898-
#-----| -> call to ...
4898+
#-----| -> init
48994899

49004900
# 379| super
49014901
#-----| -> call to ...
@@ -4909,7 +4909,7 @@ cfg.swift:
49094909
# 379| self = ...
49104910
#-----| -> return
49114911

4912-
# 379| call to ...
4912+
# 379| init
49134913
#-----| -> super
49144914

49154915
# 379| 0

swift/ql/test/library-tests/parent/parent.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@
567567
| expressions.swift:78:3:80:3 | init | ConstructorDecl | expressions.swift:78:10:80:3 | { ... } | BraceStmt |
568568
| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr |
569569
| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:80:3:80:3 | return | ReturnStmt |
570-
| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | call to ... | OtherConstructorDeclRefExpr |
570+
| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | init | OtherConstructorDeclRefExpr |
571571
| expressions.swift:79:5:79:21 | call to ... | CallExpr | expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr |
572572
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | expressions.swift:78:3:78:3 | self | ParamDecl |
573573
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | expressions.swift:79:5:79:21 | call to ... | CallExpr |

0 commit comments

Comments
 (0)