|
202 | 202 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=COMPLETE_CALL_RESULT | %FileCheck %s -check-prefix=COMPLETE_CALL_RESULT
|
203 | 203 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-keywords=false -code-completion-token=BROKEN_CONFORMANCE | %FileCheck %s -check-prefix=BROKEN_CONFORMANCE
|
204 | 204 |
|
| 205 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOLMETA_1 | %FileCheck %s -check-prefix=PROTOCOLMETA_1 |
| 206 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOLMETA_2 | %FileCheck %s -check-prefix=PROTOCOLMETA_2 |
| 207 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOLMETA_3 | %FileCheck %s -check-prefix=PROTOCOLMETA_3 |
| 208 | + |
205 | 209 | // Test code completion of expressions that produce a value.
|
206 | 210 |
|
207 | 211 | struct FooStruct {
|
@@ -2202,3 +2206,38 @@ func testBrokenConformance(arg: BrokenConformanceS) {
|
2202 | 2206 | // BROKEN_CONFORMANCE: Decl[InstanceMethod]/Super: instanceFunc()[#Void#];
|
2203 | 2207 | // BROKEN_CONFORMANCE: End completions
|
2204 | 2208 | }
|
| 2209 | + |
| 2210 | +protocol MetaProto { |
| 2211 | + static func staticFunc() -> Int |
| 2212 | + static var staticVar: Int { get } |
| 2213 | + func instanceFunc() -> Int |
| 2214 | + var intanceVar: Int { get } |
| 2215 | +} |
| 2216 | +extension MetaProto { |
| 2217 | + static func staticFuncExtension() -> Int { 1 } |
| 2218 | + static var staticVarExtension: Int { 1 } |
| 2219 | + func instanceFuncExtension() -> Int { 1 } |
| 2220 | + var intanceVarExtension: Int { 1 } |
| 2221 | +} |
| 2222 | +func testProtocolMetatype(protoProto: MetaProto.Protocol, protoType: MetaProto.Type) { |
| 2223 | + let _ = BrokenConformanceP.#^PROTOCOLMETA_1^# |
| 2224 | +// PROTOCOLMETA_1: Begin completions, 3 items |
| 2225 | +// PROTOCOLMETA_1-DAG: Keyword[self]/CurrNominal: self[#BrokenConformanceP.Protocol#]; name=self |
| 2226 | +// PROTOCOLMETA_1-DAG: Keyword/CurrNominal: Protocol[#BrokenConformanceP.Protocol#]; name=Protocol |
| 2227 | +// PROTOCOLMETA_1-DAG: Keyword/CurrNominal: Type[#BrokenConformanceP.Type#]; name=Type |
| 2228 | +// PROTOCOLMETA_1: End completions |
| 2229 | + let _ = protoProto.#^PROTOCOLMETA_2^# |
| 2230 | +// PROTOCOLMETA_2: Begin completions, 1 items |
| 2231 | +// PROTOCOLMETA_2-DAG: Keyword[self]/CurrNominal: self[#MetaProto.Protocol#]; name=self |
| 2232 | +// PROTOCOLMETA_2: End completions |
| 2233 | + let _ = protoType.#^PROTOCOLMETA_3^# |
| 2234 | +// PROTOCOLMETA_3: Begin completions, 7 items |
| 2235 | +// PROTOCOLMETA_3-DAG: Keyword[self]/CurrNominal: self[#MetaProto.Type#]; name=self |
| 2236 | +// PROTOCOLMETA_3-DAG: Decl[StaticMethod]/CurrNominal: staticFunc()[#Int#]; name=staticFunc() |
| 2237 | +// PROTOCOLMETA_3-DAG: Decl[StaticVar]/CurrNominal: staticVar[#Int#]; name=staticVar |
| 2238 | +// PROTOCOLMETA_3-DAG: Decl[InstanceMethod]/CurrNominal: instanceFunc({#(self): Self#})[#() -> Int#]; name=instanceFunc(self: Self) |
| 2239 | +// PROTOCOLMETA_3-DAG: Decl[StaticMethod]/CurrNominal: staticFuncExtension()[#Int#]; name=staticFuncExtension() |
| 2240 | +// PROTOCOLMETA_3-DAG: Decl[StaticVar]/CurrNominal: staticVarExtension[#Int#]; name=staticVarExtension |
| 2241 | +// PROTOCOLMETA_3-DAG: Decl[InstanceMethod]/CurrNominal: instanceFuncExtension({#(self): Self#})[#() -> Int#]; name=instanceFuncExtension(self: Self) |
| 2242 | +// PROTOCOLMETA_3: End completions |
| 2243 | +} |
0 commit comments