Re: [swift-users] Covariance in Generic Protocols & Proposal 0142

2017-06-25 Thread Zhao Xin via swift-users
`protocol A: GenericProtocol where Instance == String { }` means, A is something that `Instance` must be `String`. However, it doesn't mean `Instance` has already been `String`. So without assigning your `Instance`, the compiler doesn't know the type of your `Instance`. Zhao Xin On Mon, Jun 26,

[swift-users] Covariance in Generic Protocols & Proposal 0142

2017-06-25 Thread Justin Jia via swift-users
Hi, I’m trying to implement something like this using Swift 4 after proposal 0142 is implemented: ``` protocol GenericProtocol { associatedtype Instance func foo() -> Instance func bar() -> Instance // and more... } protocol A: GenericProtocol where Instance == String { } protoc