Please see the code below. I don't see how the inheriting protocol is an incomplete type. In the world of C++ this would be a specialization, I guess, making the type non generic.
It would also be great to hear of alternative approaches for what I'm trying to achieve. Thanks!
protocol GenericProtocol {
associatedtype Collaborator
func add(_ collaborator: Collaborator)
}
protocol IntProtocol: GenericProtocol where Collaborator == Int {
}
struct IntImpl: IntProtocol {
func add(_ collaborator: Int) {
}
}
let specializedRef: IntProtocol = IntImpl() // Protocol 'IntProtocol' can only be used as a generic constraint because it has Self or associated type requirements