Why can this protocol "only be used as a generic constraint"?
generics, swift, xcode6
Solution
Try this:
func someFunc<T:ProtocolWithAlias>() -> T
Problem
I'm attempting to do the following in Swift: ``` protocol ProtocolWithAlias { typealias T } protocol AnotherProtocol { func someFunc() -> ProtocolWithAlias } ``` But I get the error: `Protocol 'ProtocolWithAlias' can only be used as a generic constraint because it has Self or associated type requirements`. Is it possible to do something like this? The error message (or at least the "`only be used as a generic constraint`" part) doesn't seem to make much sense to me. I'm using the latest Xcode 6 beta 3. Thanks!