|
50 | 50 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_1 | %FileCheck %s -check-prefix=AVAILABLE_1
|
51 | 51 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_1
|
52 | 52 |
|
| 53 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEPENDENT_IN_CLOSURE_1 | %FileCheck %s -check-prefix=DEPENDENT_IN_CLOSURE_1 |
| 54 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEPENDENT_IN_CLOSURE_2 | %FileCheck %s -check-prefix=DEPENDENT_IN_CLOSURE_2 |
| 55 | + |
53 | 56 | func freeFunc() {}
|
54 | 57 |
|
55 | 58 | //===---
|
@@ -369,3 +372,27 @@ func testAvailable() {
|
369 | 372 |
|
370 | 373 | let _ = AvailableTest.init(#^AVAILABLE_2^#
|
371 | 374 | }
|
| 375 | + |
| 376 | +protocol DataType { |
| 377 | + associatedtype Content |
| 378 | +} |
| 379 | +class DependentTypeInClosure<Data: DataType> { |
| 380 | + init(_ arg: Data, fn: (Data.Content) -> Void) {} |
| 381 | + init(arg: Data, fn: () -> Data.Content) {} |
| 382 | +} |
| 383 | +func testDependentTypeInClosure() { |
| 384 | + let _: DependentTypeInClosure = .#^DEPENDENT_IN_CLOSURE_3^# |
| 385 | + let _ = DependentTypeInClosure(#^DEPENDENT_IN_CLOSURE_1^#) |
| 386 | +// DEPENDENT_IN_CLOSURE_1: Begin completions |
| 387 | +// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#(arg): _#}, {#fn: (_.Content) -> Void##(_.Content) -> Void#}[')'][#DependentTypeInClosure<_>#]; |
| 388 | +// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#arg: _#}, {#fn: () -> _.Content##() -> _.Content#}[')'][#DependentTypeInClosure<_>#]; |
| 389 | +// DEPENDENT_IN_CLOSURE_1: End completions |
| 390 | + |
| 391 | + let _ = DependentTypeInClosure.#^DEPENDENT_IN_CLOSURE_2^# |
| 392 | +// DEPENDENT_IN_CLOSURE_2: Begin completions, 4 items |
| 393 | +// DEPENDENT_IN_CLOSURE_2-DAG: Keyword[self]/CurrNominal: self[#DependentTypeInClosure<_>.Type#]; name=self |
| 394 | +// DEPENDENT_IN_CLOSURE_2-DAG: Keyword/CurrNominal: Type[#DependentTypeInClosure<_>.Type#]; name=Type |
| 395 | +// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#(arg): _#}, {#fn: (_.Content) -> Void##(_.Content) -> Void#})[#DependentTypeInClosure<_>#]; name=init(arg: _, fn: (_.Content) -> Void) |
| 396 | +// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#arg: _#}, {#fn: () -> _.Content##() -> _.Content#})[#DependentTypeInClosure<_>#]; name=init(arg: _, fn: () -> _.Content) |
| 397 | +// DEPENDENT_IN_CLOSURE_2: End completions |
| 398 | +} |
0 commit comments