@@ -39,6 +39,19 @@ func foo4(s: S1) -> Int {
39
39
return c + b
40
40
}
41
41
42
+ class C1 {
43
+ func getC( ) -> C1 { return self }
44
+ func take( another : C1 ) -> C1 { return another }
45
+ let c = C1 ( )
46
+ }
47
+
48
+ func foo5( c : C1 ) -> C1 {
49
+ let a = c. c. getC ( ) . c. getC ( ) . getC ( ) . getC ( )
50
+ let b = a. c. c. c. c. getC ( ) . getC ( )
51
+ let d = a. c. getC ( ) . getC ( ) . c. c
52
+ return a. take ( another: b) . take ( another: d)
53
+ }
54
+
42
55
// RUN: %target-swift-ide-test -range -pos=8:1 -end-pos 8:32 -source-filename %s | %FileCheck %s -check-prefix=CHECK1
43
56
// RUN: %target-swift-ide-test -range -pos=9:1 -end-pos 9:26 -source-filename %s | %FileCheck %s -check-prefix=CHECK2
44
57
// RUN: %target-swift-ide-test -range -pos=10:1 -end-pos 10:27 -source-filename %s | %FileCheck %s -check-prefix=CHECK3
@@ -48,6 +61,9 @@ func foo4(s: S1) -> Int {
48
61
// RUN: %target-swift-ide-test -range -pos=14:1 -end-pos=17:15 -source-filename %s | %FileCheck %s -check-prefix=CHECK7
49
62
// RUN: %target-swift-ide-test -range -pos=31:1 -end-pos=33:15 -source-filename %s | %FileCheck %s -check-prefix=CHECK8
50
63
// RUN: %target-swift-ide-test -range -pos=37:1 -end-pos=39:15 -source-filename %s | %FileCheck %s -check-prefix=CHECK9
64
+ // RUN: %target-swift-ide-test -range -pos=49:1 -end-pos=50:34 -source-filename %s | %FileCheck %s -check-prefix=CHECK10
65
+ // RUN: %target-swift-ide-test -range -pos=49:1 -end-pos=51:32 -source-filename %s | %FileCheck %s -check-prefix=CHECK11
66
+ // RUN: %target-swift-ide-test -range -pos=49:1 -end-pos=52:45 -source-filename %s | %FileCheck %s -check-prefix=CHECK12
51
67
52
68
// CHECK1: <Kind>SingleDecl</Kind>
53
69
// CHECK1-NEXT: <Content>func foo1() -> Int { return 0 }</Content>
@@ -105,9 +121,7 @@ func foo4(s: S1) -> Int {
105
121
// CHECK8-NEXT: <Type>Int</Type>
106
122
// CHECK8-NEXT: <Declared>c</Declared>
107
123
// CHECK8-NEXT: <Referenced>s</Referenced><Type>@lvalue S1</Type>
108
- // CHECK8-NEXT: <Referenced>foo</Referenced><Type>(S1) -> () -> Int</Type>
109
124
// CHECK8-NEXT: <Referenced>b</Referenced><Type>Int</Type>
110
- // CHECK8-NEXT: <Referenced>increment</Referenced><Type>(inout S1) -> () -> S1</Type>
111
125
// CHECK8-NEXT: <end>
112
126
113
127
// CHECK9: <Kind>MultiStatement</Kind>
@@ -118,7 +132,37 @@ func foo4(s: S1) -> Int {
118
132
// CHECK9-NEXT: <Declared>b</Declared>
119
133
// CHECK9-NEXT: <Declared>c</Declared>
120
134
// CHECK9-NEXT: <Referenced>s</Referenced><Type>S1</Type>
121
- // CHECK9-NEXT: <Referenced>a</Referenced><Type>Int</Type>
122
- // CHECK9-NEXT: <Referenced>foo</Referenced><Type>(S1) -> () -> Int</Type>
123
135
// CHECK9-NEXT: <Referenced>b</Referenced><Type>Int</Type>
124
136
// CHECK9-NEXT: <end>
137
+
138
+ // CHECK10: <Kind>MultiStatement</Kind>
139
+ // CHECK10-NEXT: <Content>let a = c.c.getC().c.getC().getC().getC()
140
+ // CHECK10-NEXT: let b = a.c.c.c.c.getC().getC()</Content>
141
+ // CHECK10-NEXT: <Declared>a</Declared>
142
+ // CHECK10-NEXT: <Declared>b</Declared>
143
+ // CHECK10-NEXT: <Referenced>c</Referenced><Type>C1</Type>
144
+ // CHECK10-NEXT: <end>
145
+
146
+ // CHECK11: <Kind>MultiStatement</Kind>
147
+ // CHECK11-NEXT: <Content>let a = c.c.getC().c.getC().getC().getC()
148
+ // CHECK11-NEXT: let b = a.c.c.c.c.getC().getC()
149
+ // CHECK11-NEXT: let d = a.c.getC().getC().c.c</Content>
150
+ // CHECK11-NEXT: <Declared>a</Declared>
151
+ // CHECK11-NEXT: <Declared>b</Declared>
152
+ // CHECK11-NEXT: <Declared>d</Declared>
153
+ // CHECK11-NEXT: <Referenced>c</Referenced><Type>C1</Type>
154
+ // CHECK11-NEXT: <Referenced>a</Referenced><Type>C1</Type>
155
+ // CHECK11-NEXT: <end>
156
+
157
+ // CHECK12: <Kind>MultiStatement</Kind>
158
+ // CHECK12-NEXT: <Content>let a = c.c.getC().c.getC().getC().getC()
159
+ // CHECK12-NEXT: let b = a.c.c.c.c.getC().getC()
160
+ // CHECK12-NEXT: let d = a.c.getC().getC().c.c
161
+ // CHECK12-NEXT: return a.take(another: b).take(another: d)</Content>
162
+ // CHECK12-NEXT: <Type>C1</Type>
163
+ // CHECK12-NEXT: <Declared>a</Declared>
164
+ // CHECK12-NEXT: <Declared>b</Declared>
165
+ // CHECK12-NEXT: <Declared>d</Declared>
166
+ // CHECK12-NEXT: <Referenced>c</Referenced><Type>C1</Type>
167
+ // CHECK12-NEXT: <Referenced>a</Referenced><Type>C1</Type>
168
+ // CHECK12-NEXT: <end>
0 commit comments