I have the following struct:
struct ImageSlider: CodableComponent {
let slides: [CodableComponent]?
}
which conforms to CodableComponent
protocol Component {
}
typealias CodableComponent = Component & Decodable
But I get the following error:
Type 'ImageSlider' does not conform to protocol 'Decodable'
As soon as I remove the conformance to CodableComponent in ImageSlider, like the following:
struct ImageSlider {
let slides: [CodableComponent]?
}
The error is gone.
I'm not sure what exactly is happening here, why I cannot conform to a protocol and also have a property of the same type?
Would be appreciated if someone could shed some light on this case.