I'm trying to implement a code with this structure
protocol MyClassProtocol: class {
}
protocol MyOtherProtocol {
typealias MI: MyClassProtocol
weak var interface: MI? {get set}
}
protocol MySpecializedClassProtocol: MyClassProtocol {
// Other methods
}
struct MyStruct: MySpecializedClassProtocol {
typealias MI = MySpecializedClassProtocol
weak var interface: MySpecializedClassProtocol?
}
I get an error
"possibly intended match 'MI' (aka 'MyClassProtocol') does not conform to 'MyClassProtocol' typealias MI = MyClassProtocol"
So I'm doing something wrong. But I don't understand what. How can I see in swift that MI should adopt MyClassProtocol?