-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathcomplete_dynamic_lookup.swift
493 lines (424 loc) · 30.4 KB
/
complete_dynamic_lookup.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -disable-objc-attr-requires-foundation-module -o %t %S/Inputs/AnyObject/foo_swift_module.swift
// RUN: %target-swift-frontend -emit-module -disable-objc-attr-requires-foundation-module -o %t %S/Inputs/AnyObject/bar_swift_module.swift
// RUN: cp %S/Inputs/AnyObject/baz_clang_module.h %t
// RUN: cp %S/Inputs/AnyObject/module.map %t
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_PARAM_NO_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_NO_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_PARAM_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_VAR_NO_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_NO_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_VAR_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_RETURN_VAL_NO_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_NO_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_RETURN_VAL_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_CALL_RETURN_VAL_NO_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=TLOC_MEMBERS_NO_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_CALL_RETURN_VAL_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=TLOC_MEMBERS_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_NAME_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_FUNC_NAME_1 < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_NAME_PAREN_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_FUNC_NAME_PAREN_1 < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_NAME_BANG_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_FUNC_NAME_BANG_1 < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_CLASS_NO_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_CLASS_NO_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_CLASS_DOT_1 > %t.dl.txt
// RUN: %FileCheck %s -check-prefix=DL_CLASS_DOT < %t.dl.txt
// RUN: %FileCheck %s -check-prefix=GLOBAL_NEGATIVE < %t.dl.txt
// REQUIRES: objc_interop
import foo_swift_module
import class bar_swift_module.Bar_ImportedObjcClass
import baz_clang_module
//===---
//===--- Helper types that are used in this test.
//===---
@objc class Base {}
@objc class Derived : Base {}
protocol Foo { func foo() }
protocol Bar { func bar() }
//===---
//===--- Types that contain members accessible by dynamic lookup.
//===---
// GLOBAL_NEGATIVE-NOT: ERROR
// DL_INSTANCE_NO_DOT: Begin completions
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[bar_swift_module]: .bar_ImportedObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[bar_swift_module]: .bar_ImportedObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc2!({#(a): Derived#})[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc3!({#(a): Derived#})[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc4!()[#Base#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .base1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .base1_Property2[#Base?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: .baz_Class_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: .baz_Protocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_Nested1_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: .foo_Nested1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_Nested2_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: .foo_Nested2_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelClass_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: .foo_TopLevelClass_ObjcProperty1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: .foo_TopLevelObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcProtocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: .foo_TopLevelObjcProtocol_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .nested1_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .nested1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .nested2_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .nested2_Property[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .returnsObjcClass!({#(i): Int#})[#TopLevelObjcClass#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelClass_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .topLevelClass_ObjcProperty1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .topLevelObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelObjcProtocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: .topLevelObjcProtocol_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[bar_swift_module]: [{#(i): Bar_ImportedObjcClass#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[foo_swift_module]: [{#(i): Foo_TopLevelObjcProtocol#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[swift_ide_test]: [{#(i): Int16#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[foo_swift_module]: [{#(i): Int32#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[foo_swift_module]: [{#(i): Int64#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[swift_ide_test]: [{#(i): Int8#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[swift_ide_test]: [{#(i): TopLevelObjcClass#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[swift_ide_test]: [{#(i): TopLevelObjcProtocol#}][#Int?#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[baz_clang_module]: [{#(idx): Int32#}][#Any??#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT-DAG: Decl[Subscript]/OtherModule[baz_clang_module]: [{#(key): Any!#}][#Any??#]{{; name=.+$}}
// DL_INSTANCE_NO_DOT: End completions
// GLOBAL_NEGATIVE-NOT:.objectAtIndexedSubscript
// DL_INSTANCE_DOT: Begin completions
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[bar_swift_module]: bar_ImportedObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[bar_swift_module]: bar_ImportedObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc2!({#(a): Derived#})[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc3!({#(a): Derived#})[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc4!()[#Base#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: base1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: base1_Property2[#Base?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: baz_Class_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[baz_clang_module]: baz_Class_Property1[#Baz_Class!?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[baz_clang_module]: baz_Class_Property2[#Baz_Class!?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: baz_Protocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_Nested1_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: foo_Nested1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_Nested2_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: foo_Nested2_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelClass_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: foo_TopLevelClass_ObjcProperty1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: foo_TopLevelObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcProtocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[foo_swift_module]: foo_TopLevelObjcProtocol_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: nested1_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: nested1_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: nested2_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: nested2_Property[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: returnsObjcClass!({#(i): Int#})[#TopLevelObjcClass#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelClass_ObjcInstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: topLevelClass_ObjcProperty1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelObjcClass_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: topLevelObjcClass_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelObjcProtocol_InstanceFunc1!()[#Void#]{{; name=.+$}}
// DL_INSTANCE_DOT-DAG: Decl[InstanceVar]/OtherModule[swift_ide_test]: topLevelObjcProtocol_Property1[#Int?#]{{; name=.+$}}
// DL_INSTANCE_DOT: End completions
// DL_CLASS_NO_DOT: Begin completions
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[bar_swift_module]: .bar_ImportedObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[bar_swift_module]: .bar_ImportedObjcClass_InstanceFunc1({#(self): Bar_ImportedObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc1({#(self): Base1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc2({#(self): Base1#})[#(Derived) -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc3({#(self): Base1#})[#(Derived) -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .base1_InstanceFunc4({#(self): Base1#})[#() -> Base#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[baz_clang_module]: .baz_Class_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: .baz_Class_InstanceFunc1({#(self): Baz_Class#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[baz_clang_module]: .baz_Protocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: .baz_Protocol_InstanceFunc1({#(self): Baz_Protocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: .foo_Nested1_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_Nested1_ObjcInstanceFunc1({#(self): Foo_ContainerForNestedClass1.Foo_Nested1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: .foo_Nested2_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_Nested2_ObjcInstanceFunc1({#(self): Foo_ContainerForNestedClass2.Foo_Nested2#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: .foo_TopLevelClass_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelClass_ObjcInstanceFunc1({#(self): Foo_TopLevelClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcClass_InstanceFunc1({#(self): Foo_TopLevelObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcProtocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: .foo_TopLevelObjcProtocol_InstanceFunc1({#(self): Foo_TopLevelObjcProtocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: .nested1_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .nested1_ObjcInstanceFunc1({#(self): ContainerForNestedClass1.Nested1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: .nested2_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .nested2_ObjcInstanceFunc1({#(self): ContainerForNestedClass2.Nested2#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .returnsObjcClass({#(self): TopLevelObjcClass#})[#(Int) -> TopLevelObjcClass#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: .topLevelClass_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelClass_ObjcInstanceFunc1({#(self): TopLevelClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: .topLevelObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelObjcClass_InstanceFunc1({#(self): TopLevelObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: .topLevelObjcProtocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: .topLevelObjcProtocol_InstanceFunc1({#(self): TopLevelObjcProtocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_NO_DOT: End completions
// DL_CLASS_DOT: Begin completions
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[bar_swift_module]: bar_ImportedObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[bar_swift_module]: bar_ImportedObjcClass_InstanceFunc1({#(self): Bar_ImportedObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc1({#(self): Base1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc2({#(self): Base1#})[#(Derived) -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc3({#(self): Base1#})[#(Derived) -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: base1_InstanceFunc4({#(self): Base1#})[#() -> Base#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[baz_clang_module]: baz_Class_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: baz_Class_InstanceFunc1({#(self): Baz_Class#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[baz_clang_module]: baz_Protocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[baz_clang_module]: baz_Protocol_InstanceFunc1({#(self): Baz_Protocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: foo_Nested1_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_Nested1_ObjcInstanceFunc1({#(self): Foo_ContainerForNestedClass1.Foo_Nested1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: foo_Nested2_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_Nested2_ObjcInstanceFunc1({#(self): Foo_ContainerForNestedClass2.Foo_Nested2#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: foo_TopLevelClass_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelClass_ObjcInstanceFunc1({#(self): Foo_TopLevelClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcClass_InstanceFunc1({#(self): Foo_TopLevelObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcProtocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[foo_swift_module]: foo_TopLevelObjcProtocol_InstanceFunc1({#(self): Foo_TopLevelObjcProtocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: nested1_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: nested1_ObjcInstanceFunc1({#(self): ContainerForNestedClass1.Nested1#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: nested2_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: nested2_ObjcInstanceFunc1({#(self): ContainerForNestedClass2.Nested2#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: returnsObjcClass({#(self): TopLevelObjcClass#})[#(Int) -> TopLevelObjcClass#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: topLevelClass_ObjcClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelClass_ObjcInstanceFunc1({#(self): TopLevelClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: topLevelObjcClass_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelObjcClass_InstanceFunc1({#(self): TopLevelObjcClass#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[StaticMethod]/OtherModule[swift_ide_test]: topLevelObjcProtocol_ClassFunc1()[#Void#]{{; name=.+$}}
// DL_CLASS_DOT-DAG: Decl[InstanceMethod]/OtherModule[swift_ide_test]: topLevelObjcProtocol_InstanceFunc1({#(self): TopLevelObjcProtocol#})[#() -> Void#]{{; name=.+$}}
// DL_CLASS_DOT: End completions
// TLOC_MEMBERS_NO_DOT: Begin completions
// TLOC_MEMBERS_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .returnsObjcClass({#(i): Int#})[#TopLevelObjcClass#]{{; name=.+$}}
// TLOC_MEMBERS_NO_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: .topLevelObjcClass_InstanceFunc1()[#Void#]{{; name=.+$}}
// TLOC_MEMBERS_NO_DOT-NEXT: Decl[Subscript]/CurrNominal: [{#(i): Int8#}][#Int#]{{; name=.+$}}
// TLOC_MEMBERS_NO_DOT-NEXT: Decl[InstanceVar]/CurrNominal: .topLevelObjcClass_Property1[#Int#]{{; name=.+$}}
// TLOC_MEMBERS_NO_DOT-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: === {#AnyObject?#}[#Bool#];
// TLOC_MEMBERS_NO_DOT-DAG: Decl[InfixOperatorFunction]/OtherModule[Swift]: !== {#AnyObject?#}[#Bool#];
// TLOC_MEMBERS_NO_DOT-NEXT: Keyword[self]/CurrNominal: .self[#TopLevelObjcClass#]; name=self
// TLOC_MEMBERS_NO_DOT-NEXT: End completions
// TLOC_MEMBERS_DOT: Begin completions
// TLOC_MEMBERS_DOT-NEXT: Keyword[self]/CurrNominal: self[#TopLevelObjcClass#]; name=self
// TLOC_MEMBERS_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: returnsObjcClass({#(i): Int#})[#TopLevelObjcClass#]{{; name=.+$}}
// TLOC_MEMBERS_DOT-NEXT: Decl[InstanceMethod]/CurrNominal: topLevelObjcClass_InstanceFunc1()[#Void#]{{; name=.+$}}
// TLOC_MEMBERS_DOT-NEXT: Decl[InstanceVar]/CurrNominal: topLevelObjcClass_Property1[#Int#]{{; name=.+$}}
// TLOC_MEMBERS_DOT-NEXT: End completions
// FIXME: Properties in Clang modules.
// There's a test already: baz_Protocol_Property1.
// Blocked by: rdar://15136550 Properties in protocols not implemented
@objc class TopLevelObjcClass {
@objc func returnsObjcClass(_ i: Int) -> TopLevelObjcClass {}
@objc func topLevelObjcClass_InstanceFunc1() {}
@objc class func topLevelObjcClass_ClassFunc1() {}
@objc subscript(i: Int8) -> Int {
get {
return 0
}
}
@objc var topLevelObjcClass_Property1: Int
}
@objc class TopLevelObjcClass_DuplicateMembers {
@objc func topLevelObjcClass_InstanceFunc1() {}
@objc class func topLevelObjcClass_ClassFunc1() {}
@objc subscript(i: Int8) -> Int {
get {
return 0
}
}
@objc var topLevelObjcClass_Property1: Int
}
class TopLevelClass {
@objc func topLevelClass_ObjcInstanceFunc1() {}
@objc class func topLevelClass_ObjcClassFunc1() {}
@objc subscript (i: Int16) -> Int {
get {
return 0
}
}
@objc var topLevelClass_ObjcProperty1: Int
func ERROR() {}
typealias ERROR = Int
subscript (i: ERROR) -> Int {
get {
return 0
}
}
var ERROR_Property: Int
}
@objc protocol TopLevelObjcProtocol {
@objc func topLevelObjcProtocol_InstanceFunc1()
@objc class func topLevelObjcProtocol_ClassFunc1()
@objc subscript (i: TopLevelObjcClass) -> Int { get set }
@objc var topLevelObjcProtocol_Property1: Int { get set }
}
class ContainerForNestedClass1 {
class Nested1 {
@objc func nested1_ObjcInstanceFunc1() {}
@objc class func nested1_ObjcClassFunc1() {}
@objc var nested1_Property1: Int
func ERROR() {}
typealias ERROR = Int
subscript (i: ERROR) -> Int {
get {
return 0
}
}
var ERROR_Property: Int
}
func ERROR() {}
}
struct ContainerForNestedClass2 {
class Nested2 {
@objc func nested2_ObjcInstanceFunc1() {}
@objc class func nested2_ObjcClassFunc1() {}
@objc subscript (i: TopLevelObjcProtocol) -> Int {
get {
return 0
}
}
@objc var nested2_Property: Int
func ERROR() {}
var ERROR_Property: Int
}
func ERROR() {}
}
class GenericContainerForNestedClass1<T> {
class Nested3 {
func ERROR1() {}
func ERROR2() {}
class func ERROR3() {}
typealias ERROR = Int
subscript (i: ERROR) -> Int {
get {
return 0
}
}
var ERROR_Property: Int
}
func ERROR() {}
}
struct GenericContainerForNestedClass2<T> {
class Nested3 {
func ERROR1() {}
func ERROR2() {}
class func ERROR3() {}
typealias ERROR = Int
subscript (i: ERROR) -> Int {
get {
return 0
}
}
var ERROR_Property: Int
}
func ERROR() {}
}
@objc class Base1 {
@objc func base1_InstanceFunc1() {}
@objc func base1_InstanceFunc2(_ a: Derived) {}
@objc func base1_InstanceFunc3(_ a: Derived) {}
@objc func base1_InstanceFunc4() -> Base {}
@objc var base1_Property1: Int
@objc var base1_Property2: Base
}
@objc class Derived1 : Base1 {
@objc func base1_InstanceFunc1() {}
@objc func base1_InstanceFunc2(_ a: Derived) {}
@objc func base1_InstanceFunc3(_ a: Base) {}
@objc func base1_InstanceFunc4() -> Derived {}
@objc var base1_Property1: Int {
get {
return 0
}
set {}
}
@objc var base1_Property2: Derived {
get {
return Derived()
}
set {}
}
}
func returnsAnyObject() -> AnyObject {
return TopLevelClass()
}
func testAnyObject1(_ dl: AnyObject) {
dl#^DL_FUNC_PARAM_NO_DOT_1^#
}
func testAnyObject2(_ dl: AnyObject) {
dl.#^DL_FUNC_PARAM_DOT_1^#
}
func testAnyObject3() {
var dl: AnyObject = TopLevelClass()
dl#^DL_VAR_NO_DOT_1^#
}
func testAnyObject4() {
var dl: AnyObject = TopLevelClass()
dl.#^DL_VAR_DOT_1^#
}
func testAnyObject5() {
returnsAnyObject()#^DL_RETURN_VAL_NO_DOT_1^#
}
func testAnyObject6() {
returnsAnyObject().#^DL_RETURN_VAL_DOT_1^#
}
func testAnyObject7(_ dl: AnyObject) {
dl.returnsObjcClass!(42)#^DL_CALL_RETURN_VAL_NO_DOT_1^#
}
func testAnyObject8(_ dl: AnyObject) {
dl.returnsObjcClass!(42).#^DL_CALL_RETURN_VAL_DOT_1^#
}
func testAnyObject9() {
// FIXME: this syntax is not implemented yet.
// dl.returnsObjcClass?(42)#^DL_CALL_RETURN_OPTIONAL_NO_DOT_1^#
}
func testAnyObject10() {
// FIXME: this syntax is not implemented yet.
// dl.returnsObjcClass?(42).#^DL_CALL_RETURN_OPTIONAL_DOT_1^#
}
func testAnyObject11(_ dl: AnyObject) {
dl.returnsObjcClass#^DL_FUNC_NAME_1^#
}
// FIXME: it would be nice if we produced a call pattern here.
// DL_FUNC_NAME_1: Begin completions
// DL_FUNC_NAME_1: End completions
func testAnyObject11_(_ dl: AnyObject) {
dl.returnsObjcClass!(#^DL_FUNC_NAME_PAREN_1^#
}
// DL_FUNC_NAME_PAREN_1: Begin completions
// DL_FUNC_NAME_PAREN_1-DAG: Decl[InstanceMethod]/CurrNominal: ['(']{#(i): Int#}[')'][#TopLevelObjcClass#]{{; name=.+$}}
// DL_FUNC_NAME_PAREN_1: End completions
func testAnyObject12(_ dl: AnyObject) {
dl.returnsObjcClass.#^DL_FUNC_NAME_DOT_1^#
}
// FIXME: it would be nice if we produced a call pattern here.
func testAnyObject13(_ dl: AnyObject) {
dl.returnsObjcClass!#^DL_FUNC_NAME_BANG_1^#
}
// DL_FUNC_NAME_BANG_1: Begin completions
// DL_FUNC_NAME_BANG_1-NEXT: Decl[InstanceMethod]/CurrNominal: ({#(i): Int#})[#TopLevelObjcClass#]
// DL_FUNC_NAME_BANG_1-NEXT: Keyword[self]/CurrNominal: .self[#(Int) -> TopLevelObjcClass#]; name=self
// DL_FUNC_NAME_BANG_1-NEXT: End completions
func testAnyObject14() {
// FIXME: this syntax is not implemented yet.
// dl.returnsObjcClass?#^DL_FUNC_QUESTION_1^#
}
func testAnyObjectClassMethods1(_ dl: AnyObject) {
type(of: dl)#^DL_CLASS_NO_DOT_1^#
}
func testAnyObjectClassMethods2(_ dl: AnyObject) {
type(of: dl).#^DL_CLASS_DOT_1^#
}