It's hard for me to give a good title to the question, but here is my case:
protocol A: class {}
protocol B: A {}
protocol C {
var P: A { get set }
}
class D: C {
var P: B
}
The error that I get is:
Type ‘D’ does not conform to protocol ‘C’
Basically, from my understanding, this error should not happen because protocol B implements protocol A, which means that class D actually does conform to protocol C. I guess the compiler cannot infer that and I need to guide it through that. Can anyone explain to me how I can do that?
I appreciate the help, thank you.