|
22 | 22 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POSTFIX_TestProtocol_DOT | %FileCheck %s -check-prefix=POSTFIX_TestProtocol_DOT
|
23 | 23 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POSTFIX_TestProtocol_NODOT | %FileCheck %s -check-prefix=POSTFIX_TestProtocol_NODOT
|
24 | 24 |
|
| 25 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERRIDE_TestProtocol2 | %FileCheck %s -check-prefix=OVERRIDE_TestProtocol2 |
| 26 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=POSTFIX_ConcreteTestProtocol2 | %FileCheck %s -check-prefix=POSTFIX_ConcreteTestProtocol2 |
| 27 | + |
25 | 28 | protocol MyProtocol {
|
26 | 29 | associatedtype Mistery
|
27 | 30 | }
|
@@ -200,3 +203,36 @@ func postfixExpr() {
|
200 | 203 | // POSTFIX_TestProtocol_NODOT-DAG: BuiltinOperator/None: = {#TestProtocol#}[#Void#]; name={{.*$}}
|
201 | 204 | // POSTFIX_TestProtocol_NODOT-DAG: Keyword[self]/CurrNominal: .self[#TestProtocol#]; name={{.*$}}
|
202 | 205 | // POSTFIX_TestProtocol_NODOT-DAG: End completions
|
| 206 | + |
| 207 | +protocol TestProtocol2 { |
| 208 | + associatedtype Assoc: Comparable |
| 209 | + func foo() -> Assoc |
| 210 | + func bar() -> Assoc |
| 211 | + func baz(x: @autoclosure () -> Assoc) -> (Assoc) -> Assoc |
| 212 | +} |
| 213 | +extension TestProtocol2 { |
| 214 | + func inExt() -> Assoc { fatalError() } |
| 215 | +} |
| 216 | +struct ConcreteTestProtocol2: TestProtocol2 { |
| 217 | + func foo() -> some Comparable { 1 } |
| 218 | + #^OVERRIDE_TestProtocol2^# |
| 219 | +// OVERRIDE_TestProtocol2: Begin completions |
| 220 | +// OVERRIDE_TestProtocol2-NOT: foo() |
| 221 | +// OVERRIDE_TestProtocol2-NOT: inExt() |
| 222 | +// OVERRIDE_TestProtocol2-DAG: Decl[InstanceMethod]/Super: func bar() -> Assoc {|}; |
| 223 | +// OVERRIDE_TestProtocol2-DAG: Decl[InstanceMethod]/Super: func baz(x: @autoclosure () -> Assoc) -> (Assoc) -> Assoc {|}; |
| 224 | +// OVERRIDE_TestProtocol2-DAG: Decl[AssociatedType]/Super: typealias Assoc = {#(Type)#}; |
| 225 | +// OVERRIDE_TestProtocol2-NOT: foo() |
| 226 | +// OVERRIDE_TestProtocol2-NOT: inExt() |
| 227 | +// OVERRIDE_TestProtocol2: End completions |
| 228 | +} |
| 229 | +func testUseTestProtocol2(value: ConcreteTestProtocol2) { |
| 230 | + value.#^POSTFIX_ConcreteTestProtocol2^# |
| 231 | +// POSTFIX_ConcreteTestProtocol2: Begin completions |
| 232 | +// POSTFIX_ConcreteTestProtocol2-DAG: Keyword[self]/CurrNominal: self[#ConcreteTestProtocol2#]; |
| 233 | +// POSTFIX_ConcreteTestProtocol2-DAG: Decl[InstanceMethod]/CurrNominal: foo()[#Comparable#]; |
| 234 | +// POSTFIX_ConcreteTestProtocol2-DAG: Decl[InstanceMethod]/Super: bar()[#ConcreteTestProtocol2.Assoc#]; |
| 235 | +// POSTFIX_ConcreteTestProtocol2-DAG: Decl[InstanceMethod]/Super: baz({#x: ConcreteTestProtocol2.Assoc#})[#(ConcreteTestProtocol2.Assoc) -> ConcreteTestProtocol2.Assoc#]; |
| 236 | +// POSTFIX_ConcreteTestProtocol2-DAG: Decl[InstanceMethod]/Super: inExt()[#ConcreteTestProtocol2.Assoc#]; |
| 237 | +// POSTFIX_ConcreteTestProtocol2: End completions |
| 238 | +} |
0 commit comments