|
47 | 47 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_3 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
|
48 | 48 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_4 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
|
49 | 49 |
|
| 50 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_1 | %FileCheck %s -check-prefix=AVAILABLE_1 |
| 51 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_2 |
| 52 | + |
50 | 53 | func freeFunc() {}
|
51 | 54 |
|
52 | 55 | //===---
|
@@ -332,3 +335,33 @@ struct ClosureInInit1 {
|
332 | 335 | S(#^CLOSURE_IN_INIT_4^#
|
333 | 336 | }()
|
334 | 337 | }
|
| 338 | + |
| 339 | +public class AvailableTest { |
| 340 | + |
| 341 | + @available(swift, obsoleted: 4) |
| 342 | + init(opt: Int) { } |
| 343 | + |
| 344 | + @available(swift, introduced: 4) |
| 345 | + init?(opt: Int) { } |
| 346 | + |
| 347 | + init(normal1: Int) { } |
| 348 | + init(normal2: Int) { } |
| 349 | + |
| 350 | + |
| 351 | +} |
| 352 | +func testAvailable() { |
| 353 | + let _ = AvailableTest(#^AVAILABLE_1^# |
| 354 | +// AVAILABLE_1: Begin completions, 3 items |
| 355 | +// AVAILABLE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#opt: Int#}[')'][#AvailableTest?#]; name=opt: Int |
| 356 | +// AVAILABLE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#normal1: Int#}[')'][#AvailableTest#]; name=normal1: Int |
| 357 | +// AVAILABLE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#normal2: Int#}[')'][#AvailableTest#]; name=normal2: Int |
| 358 | +// AVAILABLE_1: End completions |
| 359 | + |
| 360 | + let _ = AvailableTest.init(#^AVAILABLE_2^# |
| 361 | +// AVAILABLE_2: Begin completions, 3 items |
| 362 | +// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#opt: Int#}[')'][#AvailableTest?#]; name=opt: Int |
| 363 | +// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#normal1: Int#}[')'][#AvailableTest#]; name=normal1: Int |
| 364 | +// AVAILABLE_2-DAG: Pattern/CurrModule: ['(']{#normal2: Int#}[')'][#AvailableTest#]; name=normal2: Int |
| 365 | +// AVAILABLE_2: End completions |
| 366 | + |
| 367 | +} |
0 commit comments