|
115 | 115 |
|
116 | 116 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPEPARAM_IN_CONTEXTTYPE_1 | %FileCheck %s -check-prefix=TYPEPARAM_IN_CONTEXTTYPE_1
|
117 | 117 |
|
| 118 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_1 | %FileCheck %s -check-prefix=UNRESOLVED_3 |
| 119 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_2 | %FileCheck %s -check-prefix=UNRESOLVED_3 |
| 120 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TERNARY_3 | %FileCheck %s -check-prefix=UNRESOLVED_3 |
| 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 |
| 125 | + |
118 | 126 | enum SomeEnum1 {
|
119 | 127 | case South
|
120 | 128 | case North
|
@@ -732,3 +740,24 @@ func testTypeParamInContextType() {
|
732 | 740 | // TYPEPARAM_IN_CONTEXTTYPE_1-DAG: Decl[StaticVar]/CurrNominal/TypeRelation[Convertible]: myProtocolOption[#MyStruct<ConcreteMyProtocol>#];
|
733 | 741 | // TYPEPARAM_IN_CONTEXTTYPE_1: End completions
|
734 | 742 | }
|
| 743 | + |
| 744 | +func testTernaryOperator(cond: Bool) { |
| 745 | + let _: SomeEnum1 = cond ? .#^TERNARY_1^# |
| 746 | + func sync(){} |
| 747 | + let _: SomeEnum1 = cond ? .#^TERNARY_2^# : |
| 748 | + func sync(){} |
| 749 | + let _: SomeEnum1 = cond ? .#^TERNARY_3^# : .South |
| 750 | + func sync(){} |
| 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 |
| 763 | +} |
0 commit comments