【发布时间】:2014-07-12 01:56:34
【问题描述】:
我正在尝试在 Swift 中执行以下操作:
protocol ProtocolWithAlias {
typealias T
}
protocol AnotherProtocol {
func someFunc() -> ProtocolWithAlias
}
但我收到错误:Protocol 'ProtocolWithAlias' can only be used as a generic constraint because it has Self or associated type requirements。
有可能做这样的事情吗?错误消息(或至少是“only be used as a generic constraint”部分)对我来说似乎没有多大意义。
我正在使用最新的 Xcode 6 beta 3。
谢谢!
【问题讨论】: