|
119 | 119 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_2 | %FileCheck %s -check-prefix=UNRESOLVED_3
|
120 | 120 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_3 | %FileCheck %s -check-prefix=UNRESOLVED_3
|
121 | 121 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_4 | %FileCheck %s -check-prefix=UNRESOLVED_3
|
| 122 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_5 | %FileCheck %s -check-prefix=UNRESOLVED_3 |
| 123 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_6 | %FileCheck %s -check-prefix=UNRESOLVED_3 |
| 124 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_CONDITION | %FileCheck %s -check-prefix=TERNARY_CONDITION |
122 | 125 |
|
123 | 126 | enum SomeEnum1 {
|
124 | 127 | case South
|
@@ -738,12 +741,23 @@ func testTypeParamInContextType() {
|
738 | 741 | // TYPEPARAM_IN_CONTEXTTYPE_1: End completions
|
739 | 742 | }
|
740 | 743 |
|
741 |
| -func testTernaryOperator() { |
742 |
| - let _: SomeEnum1 = true ? .#^TERNARY_1^# |
| 744 | +func testTernaryOperator(cond: Bool) { |
| 745 | + let _: SomeEnum1 = cond ? .#^TERNARY_1^# |
743 | 746 | func sync(){}
|
744 |
| - let _: SomeEnum1 = true ? .#^TERNARY_2^# : |
| 747 | + let _: SomeEnum1 = cond ? .#^TERNARY_2^# : |
745 | 748 | func sync(){}
|
746 |
| - let _: SomeEnum1 = true ? .#^TERNARY_3^# : .South |
| 749 | + let _: SomeEnum1 = cond ? .#^TERNARY_3^# : .South |
747 | 750 | func sync(){}
|
748 |
| - let _: SomeEnum1 = true ? .South : .#^TERNARY_4^# |
| 751 | + let _: SomeEnum1 = cond ? .South : .#^TERNARY_4^# |
| 752 | +} |
| 753 | + |
| 754 | +func testTernaryOperator2(cond: Bool) { |
| 755 | + let _: SomeEnum1 = cond ? .#^TERNARY_5^# : .bogus |
| 756 | + func sync(){} |
| 757 | + let _: SomeEnum1 = cond ? .bogus : .#^TERNARY_6^# |
| 758 | + func sync(){} |
| 759 | + let _: SomeEnum1 = .#^TERNARY_CONDITION^# ? .bogus : .bogus |
| 760 | +// TERNARY_CONDITION: Begin completions |
| 761 | +// TERNARY_CONDITION-DAG: Decl[Constructor]/CurrNominal/TypeRelation[Identical]: init()[#Bool#]; name=init() |
| 762 | +// TERNARY_CONDITION: End completions |
749 | 763 | }
|
0 commit comments