Skip to content

Commit f4363e3

Browse files
authored
Merge pull request #9619 from MathiasVP/swift-better-function-names
Swift: Generate better declaration names
2 parents fc7e0ec + a1bf448 commit f4363e3

File tree

17 files changed

+1282
-1275
lines changed

17 files changed

+1282
-1275
lines changed

swift/extractor/visitors/DeclVisitor.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
258258
void emitAbstractFunctionDecl(swift::AbstractFunctionDecl* decl,
259259
TrapLabel<AbstractFunctionDeclTag> label) {
260260
assert(decl->hasParameterList() && "Expect functions to have a parameter list");
261-
auto name = !decl->hasName() || decl->getName().isSpecial() ? "(unnamed function decl)"
262-
: decl->getNameStr().str();
261+
auto name = !decl->hasName() ? "(unnamed function decl)" : constructName(decl->getName());
263262
dispatcher_.emit(AbstractFunctionDeclsTrap{label, name});
264263
if (auto body = decl->getBody()) {
265264
dispatcher_.emit(AbstractFunctionDeclBodiesTrap{label, dispatcher_.fetchLabel(body)});
@@ -355,6 +354,22 @@ class DeclVisitor : public AstVisitorBase<DeclVisitor> {
355354
emitValueDecl(decl, label);
356355
}
357356

357+
// Constructs a `std::string` of the form `f(x:y:)` for a declaration
358+
// like `func f(x first: Int, y second: Int) { }`
359+
std::string constructName(swift::DeclName declName) {
360+
std::string name = declName.getBaseName().userFacingName().str();
361+
name += "(";
362+
for (auto argName : declName.getArgumentNames()) {
363+
if (argName.empty()) {
364+
name += "_:";
365+
} else {
366+
name += argName.str().str() + ":";
367+
}
368+
}
369+
name += ")";
370+
return name;
371+
}
372+
358373
private:
359374
swift::Mangle::ASTMangler mangler;
360375
};

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
| declarations.swift:24:5:24:44 | var ... = ... |
6363
| declarations.swift:24:9:24:9 | doesNotNeedToBeSettable |
6464
| declarations.swift:24:40:24:40 | get |
65-
| declarations.swift:25:5:25:22 | random |
66-
| declarations.swift:28:1:28:37 | a_function |
65+
| declarations.swift:25:5:25:22 | random() |
66+
| declarations.swift:28:1:28:37 | a_function(a_parameter:) |
6767
| declarations.swift:28:17:28:31 | a_parameter |
6868
| declarations.swift:30:1:30:18 | var ... = ... |
6969
| declarations.swift:30:1:30:18 | { ... } |
@@ -89,7 +89,7 @@
8989
| declarations.swift:42:3:44:3 | init |
9090
| declarations.swift:46:3:46:3 | self |
9191
| declarations.swift:46:3:48:3 | deinit |
92-
| declarations.swift:50:3:52:3 | +- |
92+
| declarations.swift:50:3:52:3 | +-(_:) |
9393
| declarations.swift:50:26:50:33 | other |
9494
| declarations.swift:55:8:55:17 | +- |
9595
| declarations.swift:57:1:62:1 | precedencegroup ... |
@@ -100,7 +100,7 @@
100100
| declarations.swift:69:3:73:3 | var ... = ... |
101101
| declarations.swift:69:7:69:7 | wrappedValue |
102102
| declarations.swift:70:5:72:5 | get |
103-
| declarations.swift:76:1:79:1 | foo |
103+
| declarations.swift:76:1:79:1 | foo() |
104104
| declarations.swift:77:16:77:23 | var ... = ... |
105105
| declarations.swift:77:20:77:20 | _x |
106106
| declarations.swift:77:20:77:20 | get |
@@ -206,6 +206,6 @@
206206
| declarations.swift:132:5:132:15 | willSet |
207207
| declarations.swift:134:5:134:14 | didSet |
208208
| declarations.swift:138:1:142:1 | extension |
209-
| declarations.swift:139:3:141:3 | id |
209+
| declarations.swift:139:3:141:3 | id() |
210210
| declarations.swift:139:8:139:8 | self |
211211
| declarations.swift:144:1:144:7 | { ... } |

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

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@
1111
| expressions.swift:7:11:7:10 | call to ... |
1212
| expressions.swift:7:11:7:11 | $interpolation |
1313
| expressions.swift:7:11:7:11 | &... |
14-
| expressions.swift:7:11:7:11 | call to appendLiteral |
14+
| expressions.swift:7:11:7:11 | call to appendLiteral(_:) |
1515
| expressions.swift:7:18:7:18 | $interpolation |
1616
| expressions.swift:7:18:7:18 | &... |
17-
| expressions.swift:7:18:7:18 | appendInterpolation |
18-
| expressions.swift:7:18:7:18 | call to appendInterpolation |
17+
| expressions.swift:7:18:7:18 | appendInterpolation(_:) |
18+
| expressions.swift:7:18:7:18 | call to appendInterpolation(_:) |
1919
| expressions.swift:7:18:7:20 | call to ... |
2020
| expressions.swift:7:19:7:19 | a |
2121
| expressions.swift:7:21:7:21 | |
2222
| expressions.swift:7:21:7:21 | $interpolation |
2323
| expressions.swift:7:21:7:21 | &... |
2424
| expressions.swift:7:21:7:21 | call to ... |
25-
| expressions.swift:7:21:7:21 | call to appendLiteral |
25+
| expressions.swift:7:21:7:21 | call to appendLiteral(_:) |
2626
| expressions.swift:8:15:8:15 | nil |
2727
| expressions.swift:15:9:15:9 | x |
28-
| expressions.swift:15:9:15:14 | ... call to != ... |
29-
| expressions.swift:15:11:15:11 | != |
28+
| expressions.swift:15:9:15:14 | ... call to !=(_:_:) ... |
29+
| expressions.swift:15:11:15:11 | !=(_:_:) |
3030
| expressions.swift:15:11:15:11 | Int.Type |
31-
| expressions.swift:15:11:15:11 | call to != |
31+
| expressions.swift:15:11:15:11 | call to !=(_:_:) |
3232
| expressions.swift:15:14:15:14 | 0 |
3333
| expressions.swift:16:11:16:11 | AnError.Type |
3434
| expressions.swift:16:11:16:19 | (Error) ... |
3535
| expressions.swift:16:11:16:19 | call to ... |
3636
| expressions.swift:16:19:16:19 | failed |
3737
| expressions.swift:20:1:20:16 | try! ... |
38-
| expressions.swift:20:6:20:6 | failure |
39-
| expressions.swift:20:6:20:16 | call to failure |
38+
| expressions.swift:20:6:20:6 | failure(_:) |
39+
| expressions.swift:20:6:20:16 | call to failure(_:) |
4040
| expressions.swift:20:14:20:14 | 11 |
4141
| expressions.swift:21:1:21:16 | try? ... |
42-
| expressions.swift:21:6:21:6 | failure |
42+
| expressions.swift:21:6:21:6 | failure(_:) |
4343
| expressions.swift:21:6:21:16 | (()?) ... |
44-
| expressions.swift:21:6:21:16 | call to failure |
44+
| expressions.swift:21:6:21:16 | call to failure(_:) |
4545
| expressions.swift:21:14:21:14 | 11 |
4646
| expressions.swift:27:13:27:13 | Klass.Type |
4747
| expressions.swift:27:13:27:13 | call to ... |
@@ -70,8 +70,8 @@
7070
| expressions.swift:34:1:34:12 | ... = ... |
7171
| expressions.swift:34:5:34:5 | 15 |
7272
| expressions.swift:34:5:34:12 | (Double) ... |
73-
| expressions.swift:35:1:35:1 | print |
74-
| expressions.swift:35:1:35:13 | call to print |
73+
| expressions.swift:35:1:35:1 | print(_:separator:terminator:) |
74+
| expressions.swift:35:1:35:13 | call to print(_:separator:terminator:) |
7575
| expressions.swift:35:6:35:6 | default separator |
7676
| expressions.swift:35:6:35:6 | default terminator |
7777
| expressions.swift:35:7:35:7 | d |
@@ -84,66 +84,66 @@
8484
| expressions.swift:38:3:38:15 | call to ... |
8585
| expressions.swift:38:11:38:11 | 5 |
8686
| expressions.swift:38:14:38:14 | 7 |
87-
| expressions.swift:41:1:41:1 | closured |
88-
| expressions.swift:41:1:43:1 | call to closured |
87+
| expressions.swift:41:1:41:1 | closured(closure:) |
88+
| expressions.swift:41:1:43:1 | call to closured(closure:) |
8989
| expressions.swift:41:10:43:1 | { ... } |
9090
| expressions.swift:42:12:42:12 | x |
91-
| expressions.swift:42:12:42:16 | ... call to + ... |
92-
| expressions.swift:42:14:42:14 | + |
91+
| expressions.swift:42:12:42:16 | ... call to +(_:_:) ... |
92+
| expressions.swift:42:14:42:14 | +(_:_:) |
9393
| expressions.swift:42:14:42:14 | Int.Type |
94-
| expressions.swift:42:14:42:14 | call to + |
94+
| expressions.swift:42:14:42:14 | call to +(_:_:) |
9595
| expressions.swift:42:16:42:16 | y |
96-
| expressions.swift:44:1:44:1 | closured |
97-
| expressions.swift:44:1:46:1 | call to closured |
96+
| expressions.swift:44:1:44:1 | closured(closure:) |
97+
| expressions.swift:44:1:46:1 | call to closured(closure:) |
9898
| expressions.swift:44:10:46:1 | { ... } |
9999
| expressions.swift:45:12:45:12 | x |
100-
| expressions.swift:45:12:45:16 | ... call to + ... |
101-
| expressions.swift:45:14:45:14 | + |
100+
| expressions.swift:45:12:45:16 | ... call to +(_:_:) ... |
101+
| expressions.swift:45:14:45:14 | +(_:_:) |
102102
| expressions.swift:45:14:45:14 | Int.Type |
103-
| expressions.swift:45:14:45:14 | call to + |
103+
| expressions.swift:45:14:45:14 | call to +(_:_:) |
104104
| expressions.swift:45:16:45:16 | y |
105-
| expressions.swift:47:1:47:1 | closured |
106-
| expressions.swift:47:1:47:27 | call to closured |
105+
| expressions.swift:47:1:47:1 | closured(closure:) |
106+
| expressions.swift:47:1:47:27 | call to closured(closure:) |
107107
| expressions.swift:47:10:47:27 | { ... } |
108108
| expressions.swift:47:19:47:19 | $0 |
109-
| expressions.swift:47:19:47:24 | ... call to + ... |
110-
| expressions.swift:47:22:47:22 | + |
109+
| expressions.swift:47:19:47:24 | ... call to +(_:_:) ... |
110+
| expressions.swift:47:22:47:22 | +(_:_:) |
111111
| expressions.swift:47:22:47:22 | Int.Type |
112-
| expressions.swift:47:22:47:22 | call to + |
112+
| expressions.swift:47:22:47:22 | call to +(_:_:) |
113113
| expressions.swift:47:24:47:24 | $1 |
114-
| expressions.swift:48:1:48:1 | closured |
115-
| expressions.swift:48:1:48:20 | call to closured |
114+
| expressions.swift:48:1:48:1 | closured(closure:) |
115+
| expressions.swift:48:1:48:20 | call to closured(closure:) |
116116
| expressions.swift:48:10:48:20 | { ... } |
117117
| expressions.swift:48:12:48:12 | $0 |
118-
| expressions.swift:48:12:48:17 | ... call to + ... |
119-
| expressions.swift:48:15:48:15 | + |
118+
| expressions.swift:48:12:48:17 | ... call to +(_:_:) ... |
119+
| expressions.swift:48:15:48:15 | +(_:_:) |
120120
| expressions.swift:48:15:48:15 | Int.Type |
121-
| expressions.swift:48:15:48:15 | call to + |
121+
| expressions.swift:48:15:48:15 | call to +(_:_:) |
122122
| expressions.swift:48:17:48:17 | $1 |
123123
| expressions.swift:54:1:54:1 | _ |
124124
| expressions.swift:54:1:54:8 | ... = ... |
125125
| expressions.swift:54:5:54:8 | #keyPath(...) |
126126
| expressions.swift:54:6:54:8 | UnresolvedDotExpr |
127127
| expressions.swift:58:16:58:16 | 1234 |
128-
| expressions.swift:59:1:59:1 | unsafeFunction |
129-
| expressions.swift:59:1:59:34 | call to unsafeFunction |
128+
| expressions.swift:59:1:59:1 | unsafeFunction(pointer:) |
129+
| expressions.swift:59:1:59:34 | call to unsafeFunction(pointer:) |
130130
| expressions.swift:59:25:59:26 | &... |
131131
| expressions.swift:59:25:59:26 | (UnsafePointer<Int>) ... |
132132
| expressions.swift:59:26:59:26 | myNumber |
133-
| expressions.swift:60:1:60:1 | withUnsafePointer |
134-
| expressions.swift:60:1:60:63 | call to withUnsafePointer |
133+
| expressions.swift:60:1:60:1 | withUnsafePointer(to:_:) |
134+
| expressions.swift:60:1:60:63 | call to withUnsafePointer(to:_:) |
135135
| expressions.swift:60:23:60:23 | (Int) ... |
136136
| expressions.swift:60:23:60:23 | myNumber |
137137
| expressions.swift:60:33:60:63 | ((UnsafePointer<Int>) throws -> ()) ... |
138138
| expressions.swift:60:33:60:63 | { ... } |
139-
| expressions.swift:60:35:60:35 | unsafeFunction |
140-
| expressions.swift:60:35:60:61 | call to unsafeFunction |
139+
| expressions.swift:60:35:60:35 | unsafeFunction(pointer:) |
140+
| expressions.swift:60:35:60:61 | call to unsafeFunction(pointer:) |
141141
| expressions.swift:60:59:60:59 | $0 |
142142
| expressions.swift:64:8:64:8 | x |
143-
| expressions.swift:64:8:64:12 | ... call to < ... |
144-
| expressions.swift:64:10:64:10 | < |
143+
| expressions.swift:64:8:64:12 | ... call to <(_:_:) ... |
144+
| expressions.swift:64:10:64:10 | <(_:_:) |
145145
| expressions.swift:64:10:64:10 | Int.Type |
146-
| expressions.swift:64:10:64:10 | call to < |
146+
| expressions.swift:64:10:64:10 | call to <(_:_:) |
147147
| expressions.swift:64:12:64:12 | 0 |
148148
| expressions.swift:73:5:73:5 | .xx |
149149
| expressions.swift:73:5:73:5 | self |
@@ -153,8 +153,8 @@
153153
| expressions.swift:77:7:77:7 | #... |
154154
| expressions.swift:77:7:77:7 | #... |
155155
| expressions.swift:77:7:77:7 | #... |
156-
| expressions.swift:77:7:77:7 | _unimplementedInitializer |
157-
| expressions.swift:77:7:77:7 | call to _unimplementedInitializer |
156+
| expressions.swift:77:7:77:7 | _unimplementedInitializer(className:initName:file:line:column:) |
157+
| expressions.swift:77:7:77:7 | call to _unimplementedInitializer(className:initName:file:line:column:) |
158158
| expressions.swift:77:7:77:7 | expressions.Derived |
159159
| expressions.swift:79:5:79:5 | super |
160160
| expressions.swift:79:5:79:11 | call to ... |
@@ -178,20 +178,20 @@
178178
| expressions.swift:88:1:88:7 | ...! |
179179
| expressions.swift:88:3:88:3 | a |
180180
| expressions.swift:92:14:92:14 | Unmanaged<ToPtr>.Type |
181-
| expressions.swift:92:14:92:24 | call to passRetained |
181+
| expressions.swift:92:14:92:24 | call to passRetained(_:) |
182182
| expressions.swift:92:14:92:44 | call to ... |
183-
| expressions.swift:92:14:92:46 | call to toOpaque |
183+
| expressions.swift:92:14:92:46 | call to toOpaque() |
184184
| expressions.swift:92:14:92:55 | call to ... |
185-
| expressions.swift:92:24:92:24 | passRetained |
185+
| expressions.swift:92:24:92:24 | passRetained(_:) |
186186
| expressions.swift:92:37:92:37 | ToPtr.Type |
187187
| expressions.swift:92:37:92:37 | call to ... |
188188
| expressions.swift:92:37:92:37 | init |
189189
| expressions.swift:92:37:92:43 | call to ... |
190-
| expressions.swift:92:46:92:46 | toOpaque |
190+
| expressions.swift:92:46:92:46 | toOpaque() |
191191
| expressions.swift:93:1:93:16 | Unmanaged<ToPtr>.Type |
192-
| expressions.swift:93:1:93:18 | call to fromOpaque |
192+
| expressions.swift:93:1:93:18 | call to fromOpaque(_:) |
193193
| expressions.swift:93:1:93:35 | call to ... |
194-
| expressions.swift:93:18:93:18 | fromOpaque |
194+
| expressions.swift:93:18:93:18 | fromOpaque(_:) |
195195
| expressions.swift:93:29:93:29 | (UnsafeRawPointer) ... |
196196
| expressions.swift:93:29:93:29 | opaque |
197197
| expressions.swift:99:14:99:14 | 0 |

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
| expressions.swift:7:11:7:11 | $interpolation | OrdinarySemantics |
22
| expressions.swift:7:18:7:18 | $interpolation | OrdinarySemantics |
3-
| expressions.swift:7:18:7:18 | appendInterpolation | OrdinarySemantics |
3+
| expressions.swift:7:18:7:18 | appendInterpolation(_:) | OrdinarySemantics |
44
| expressions.swift:7:19:7:19 | a | OrdinarySemantics |
55
| expressions.swift:7:21:7:21 | $interpolation | OrdinarySemantics |
66
| expressions.swift:15:9:15:9 | x | OrdinarySemantics |
7-
| expressions.swift:15:11:15:11 | != | OrdinarySemantics |
7+
| expressions.swift:15:11:15:11 | !=(_:_:) | OrdinarySemantics |
88
| expressions.swift:16:19:16:19 | failed | OrdinarySemantics |
9-
| expressions.swift:20:6:20:6 | failure | OrdinarySemantics |
10-
| expressions.swift:21:6:21:6 | failure | OrdinarySemantics |
9+
| expressions.swift:20:6:20:6 | failure(_:) | OrdinarySemantics |
10+
| expressions.swift:21:6:21:6 | failure(_:) | OrdinarySemantics |
1111
| expressions.swift:27:13:27:13 | init | OrdinarySemantics |
12-
| expressions.swift:35:1:35:1 | print | OrdinarySemantics |
12+
| expressions.swift:35:1:35:1 | print(_:separator:terminator:) | OrdinarySemantics |
1313
| expressions.swift:35:7:35:7 | d | OrdinarySemantics |
1414
| expressions.swift:35:7:35:12 | ...[...] | OrdinarySemantics |
1515
| expressions.swift:38:3:38:3 | closure | OrdinarySemantics |
16-
| expressions.swift:41:1:41:1 | closured | OrdinarySemantics |
16+
| expressions.swift:41:1:41:1 | closured(closure:) | OrdinarySemantics |
1717
| expressions.swift:42:12:42:12 | x | OrdinarySemantics |
18-
| expressions.swift:42:14:42:14 | + | OrdinarySemantics |
18+
| expressions.swift:42:14:42:14 | +(_:_:) | OrdinarySemantics |
1919
| expressions.swift:42:16:42:16 | y | OrdinarySemantics |
20-
| expressions.swift:44:1:44:1 | closured | OrdinarySemantics |
20+
| expressions.swift:44:1:44:1 | closured(closure:) | OrdinarySemantics |
2121
| expressions.swift:45:12:45:12 | x | OrdinarySemantics |
22-
| expressions.swift:45:14:45:14 | + | OrdinarySemantics |
22+
| expressions.swift:45:14:45:14 | +(_:_:) | OrdinarySemantics |
2323
| expressions.swift:45:16:45:16 | y | OrdinarySemantics |
24-
| expressions.swift:47:1:47:1 | closured | OrdinarySemantics |
24+
| expressions.swift:47:1:47:1 | closured(closure:) | OrdinarySemantics |
2525
| expressions.swift:47:19:47:19 | $0 | OrdinarySemantics |
26-
| expressions.swift:47:22:47:22 | + | OrdinarySemantics |
26+
| expressions.swift:47:22:47:22 | +(_:_:) | OrdinarySemantics |
2727
| expressions.swift:47:24:47:24 | $1 | OrdinarySemantics |
28-
| expressions.swift:48:1:48:1 | closured | OrdinarySemantics |
28+
| expressions.swift:48:1:48:1 | closured(closure:) | OrdinarySemantics |
2929
| expressions.swift:48:12:48:12 | $0 | OrdinarySemantics |
30-
| expressions.swift:48:15:48:15 | + | OrdinarySemantics |
30+
| expressions.swift:48:15:48:15 | +(_:_:) | OrdinarySemantics |
3131
| expressions.swift:48:17:48:17 | $1 | OrdinarySemantics |
32-
| expressions.swift:59:1:59:1 | unsafeFunction | OrdinarySemantics |
32+
| expressions.swift:59:1:59:1 | unsafeFunction(pointer:) | OrdinarySemantics |
3333
| expressions.swift:59:26:59:26 | myNumber | OrdinarySemantics |
34-
| expressions.swift:60:1:60:1 | withUnsafePointer | OrdinarySemantics |
34+
| expressions.swift:60:1:60:1 | withUnsafePointer(to:_:) | OrdinarySemantics |
3535
| expressions.swift:60:23:60:23 | myNumber | OrdinarySemantics |
36-
| expressions.swift:60:35:60:35 | unsafeFunction | OrdinarySemantics |
36+
| expressions.swift:60:35:60:35 | unsafeFunction(pointer:) | OrdinarySemantics |
3737
| expressions.swift:60:59:60:59 | $0 | OrdinarySemantics |
3838
| expressions.swift:64:8:64:8 | x | OrdinarySemantics |
39-
| expressions.swift:64:10:64:10 | < | OrdinarySemantics |
39+
| expressions.swift:64:10:64:10 | <(_:_:) | OrdinarySemantics |
4040
| expressions.swift:73:5:73:5 | .xx | DirectToStorage |
4141
| expressions.swift:73:5:73:5 | self | OrdinarySemantics |
4242
| expressions.swift:73:10:73:10 | x | OrdinarySemantics |
43-
| expressions.swift:77:7:77:7 | _unimplementedInitializer | OrdinarySemantics |
43+
| expressions.swift:77:7:77:7 | _unimplementedInitializer(className:initName:file:line:column:) | OrdinarySemantics |
4444
| expressions.swift:83:15:83:15 | init | OrdinarySemantics |
4545
| expressions.swift:84:5:84:5 | derived | OrdinarySemantics |
4646
| expressions.swift:84:5:84:13 | .xx | OrdinarySemantics |
4747
| expressions.swift:87:1:87:1 | opt | OrdinarySemantics |
4848
| expressions.swift:88:1:88:1 | d | OrdinarySemantics |
4949
| expressions.swift:88:1:88:6 | ...[...] | OrdinarySemantics |
50-
| expressions.swift:92:24:92:24 | passRetained | OrdinarySemantics |
50+
| expressions.swift:92:24:92:24 | passRetained(_:) | OrdinarySemantics |
5151
| expressions.swift:92:37:92:37 | init | OrdinarySemantics |
52-
| expressions.swift:92:46:92:46 | toOpaque | OrdinarySemantics |
53-
| expressions.swift:93:18:93:18 | fromOpaque | OrdinarySemantics |
52+
| expressions.swift:92:46:92:46 | toOpaque() | OrdinarySemantics |
53+
| expressions.swift:93:18:93:18 | fromOpaque(_:) | OrdinarySemantics |
5454
| expressions.swift:93:29:93:29 | opaque | OrdinarySemantics |
5555
| expressions.swift:131:3:131:3 | hp | OrdinarySemantics |
5656
| expressions.swift:131:3:131:6 | .settableField | OrdinarySemantics |
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
| functions.swift:1:1:3:1 | foo | getInterfaceType: | () -> Int | getName: | foo |
2-
| functions.swift:5:1:7:1 | bar | getInterfaceType: | (Int, Double) -> Int | getName: | bar |
3-
| functions.swift:10:5:10:28 | noBody | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int | getName: | noBody |
4-
| functions.swift:13:1:15:1 | variadic | getInterfaceType: | (Int...) -> () | getName: | variadic |
5-
| functions.swift:17:1:19:1 | generic | getInterfaceType: | <X, Y> (x: X, y: Y) -> () | getName: | generic |
1+
| functions.swift:1:1:3:1 | foo() | getInterfaceType: | () -> Int | getName: | foo() |
2+
| functions.swift:5:1:7:1 | bar(_:d:) | getInterfaceType: | (Int, Double) -> Int | getName: | bar(_:d:) |
3+
| functions.swift:10:5:10:28 | noBody(x:) | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int | getName: | noBody(x:) |
4+
| functions.swift:13:1:15:1 | variadic(_:) | getInterfaceType: | (Int...) -> () | getName: | variadic(_:) |
5+
| functions.swift:17:1:19:1 | generic(x:y:) | getInterfaceType: | <X, Y> (x: X, y: Y) -> () | getName: | generic(x:y:) |
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
| functions.swift:1:1:3:1 | foo | functions.swift:1:19:3:1 | { ... } |
2-
| functions.swift:5:1:7:1 | bar | functions.swift:5:40:7:1 | { ... } |
3-
| functions.swift:13:1:15:1 | variadic | functions.swift:13:31:15:1 | { ... } |
4-
| functions.swift:17:1:19:1 | generic | functions.swift:17:32:19:1 | { ... } |
1+
| functions.swift:1:1:3:1 | foo() | functions.swift:1:19:3:1 | { ... } |
2+
| functions.swift:5:1:7:1 | bar(_:d:) | functions.swift:5:40:7:1 | { ... } |
3+
| functions.swift:13:1:15:1 | variadic(_:) | functions.swift:13:31:15:1 | { ... } |
4+
| functions.swift:17:1:19:1 | generic(x:y:) | functions.swift:17:32:19:1 | { ... } |
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| functions.swift:17:1:19:1 | generic | 0 | functions.swift:17:14:17:14 | X |
2-
| functions.swift:17:1:19:1 | generic | 1 | functions.swift:17:17:17:17 | Y |
1+
| functions.swift:17:1:19:1 | generic(x:y:) | 0 | functions.swift:17:14:17:14 | X |
2+
| functions.swift:17:1:19:1 | generic(x:y:) | 1 | functions.swift:17:17:17:17 | Y |

0 commit comments

Comments
 (0)