17
17
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testInvalid3 | %FileCheck %s -check-prefix=testInvalid3
18
18
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testInvalid4 | %FileCheck %s -check-prefix=testInvalid4
19
19
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testGenericRoot1 | %FileCheck %s -check-prefix=testGenericRoot1
20
+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testGenericResult1 | %FileCheck %s -check-prefix=testGenericResult1
20
21
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testAnyObjectRoot1 | %FileCheck %s -check-prefix=testAnyObjectRoot1
21
22
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testNested1 | %FileCheck %s -check-prefix=testNested1
22
23
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=testNested2 | %FileCheck %s -check-prefix=testNested2
@@ -51,28 +52,25 @@ func testMembersPostfix1(r: Lens<Rectangle>) {
51
52
// testMembersPostfix1: Begin completions
52
53
// testMembersPostfix1-DAG: Decl[Subscript]/CurrNominal: [{#dynamicMember: WritableKeyPath<Rectangle, U>#}][#Lens<U>#];
53
54
54
- // FIXME: the type should be Lens<Point>
55
- // testMembersPostfix1-DAG: Decl[InstanceVar]/CurrNominal: .topLeft[#Point#];
56
- // testMembersPostfix1-DAG: Decl[InstanceVar]/CurrNominal: .bottomRight[#Point#];
55
+ // testMembersPostfix1-DAG: Decl[InstanceVar]/CurrNominal: .topLeft[#Lens<Point>#];
56
+ // testMembersPostfix1-DAG: Decl[InstanceVar]/CurrNominal: .bottomRight[#Lens<Point>#];
57
57
// testMembersPostfix1: End completions
58
58
59
59
func testMembersDot1( r: Lens < Rectangle > ) {
60
60
r. #^testMembersDot1^#
61
61
}
62
62
// testMembersDot1: Begin completions
63
- // FIXME: the type should be Lens<Point>
64
- // testMembersDot1-DAG: Decl[InstanceVar]/CurrNominal: topLeft[#Point#];
65
- // testMembersDot1-DAG: Decl[InstanceVar]/CurrNominal: bottomRight[#Point#];
63
+ // testMembersDot1-DAG: Decl[InstanceVar]/CurrNominal: topLeft[#Lens<Point>#];
64
+ // testMembersDot1-DAG: Decl[InstanceVar]/CurrNominal: bottomRight[#Lens<Point>#];
66
65
// testMembersDot1: End completions
67
66
68
67
func testMembersDot2( r: Lens < Rectangle > ) {
69
68
r. topLeft. #^testMembersDot2^#
70
69
}
71
70
72
71
// testMembersDot2: Begin completions
73
- // FIXME: the type should be Lens<Int>
74
- // testMembersDot2-DAG: Decl[InstanceVar]/CurrNominal: x[#Int#];
75
- // testMembersDot2-DAG: Decl[InstanceVar]/CurrNominal: y[#Int#];
72
+ // testMembersDot2-DAG: Decl[InstanceVar]/CurrNominal: x[#Lens<Int>#];
73
+ // testMembersDot2-DAG: Decl[InstanceVar]/CurrNominal: y[#Lens<Int>#];
76
74
// testMembersDot2: End completions
77
75
78
76
@dynamicMemberLookup
@@ -227,7 +225,7 @@ extension Lens where T: HalfRect {
227
225
}
228
226
}
229
227
// testSelfExtension1-NOT: bottomRight
230
- // testSelfExtension1: Decl[InstanceVar]/CurrNominal: topLeft[#Point#];
228
+ // testSelfExtension1: Decl[InstanceVar]/CurrNominal: topLeft[#Lens< Point> #];
231
229
// testSelfExtension1-NOT: bottomRight
232
230
233
231
struct Invalid1 {
@@ -289,8 +287,26 @@ struct GenericRoot<T> {
289
287
func testGenericRoot1( r: GenericRoot < Point > ) {
290
288
r. #^testGenericRoot1^#
291
289
}
292
- // FIXME: Type should be substituted to Int.
293
- // testGenericRoot1: Decl[InstanceVar]/CurrNominal: foo[#T#];
290
+ // testGenericRoot1: Decl[InstanceVar]/CurrNominal: foo[#Int#];
291
+
292
+ @dynamicMemberLookup
293
+ struct GenericResult < T> {
294
+ subscript< U> ( dynamicMember member: KeyPath < T , Gen1 < U > > ) -> GenericResult < U > {
295
+ fatalError ( )
296
+ }
297
+ }
298
+ struct BoxedCircle {
299
+ var center : Gen1 < Point >
300
+ var radius : Gen1 < Int >
301
+ }
302
+ func testGenericResult1( r: GenericResult < BoxedCircle > ) {
303
+ r. #^testGenericResult1^#
304
+ }
305
+ // testGenericResult1: Begin completions
306
+ // FIXME: the type should be 'GenericResult<Point>'
307
+ // testGenericResult1-DAG: Decl[InstanceVar]/CurrNominal: center[#Gen1<Point>#]; name=center
308
+ // testGenericResult1-DAG: Decl[InstanceVar]/CurrNominal: radius[#Gen1<Int>#]; name=radius
309
+ // testGenericResult1: End completions
294
310
295
311
class C {
296
312
var someUniqueName : Int = 0
@@ -312,16 +328,18 @@ func testAnyObjectRoot1(r: AnyObjectRoot) {
312
328
func testNested1( r: Lens < Lens < Point > > ) {
313
329
r. #^testNested1^#
314
330
// testNested1: Begin completions
315
- // testNested1-DAG: Decl[InstanceVar]/CurrNominal: x[#Int#];
316
- // testNested1-DAG: Decl[InstanceVar]/CurrNominal: y[#Int#];
331
+ // FIXME: The type should be 'Lens<Lens<Int>>'
332
+ // testNested1-DAG: Decl[InstanceVar]/CurrNominal: x[#Lens<Int>#];
333
+ // testNested1-DAG: Decl[InstanceVar]/CurrNominal: y[#Lens<Int>#];
317
334
// testNested1: End completions
318
335
}
319
336
320
337
func testNested2( r: Lens < Lens < Lens < Point > > > ) {
321
338
r. #^testNested2^#
322
339
// testNested2: Begin completions
323
- // testNested2-DAG: Decl[InstanceVar]/CurrNominal: x[#Int#];
324
- // testNested2-DAG: Decl[InstanceVar]/CurrNominal: y[#Int#];
340
+ // FIXME: The type should be 'Lens<Lens<Lens<Int>>>'
341
+ // testNested2-DAG: Decl[InstanceVar]/CurrNominal: x[#Lens<Int>#];
342
+ // testNested2-DAG: Decl[InstanceVar]/CurrNominal: y[#Lens<Int>#];
325
343
// testNested2: End completions
326
344
}
327
345
0 commit comments