Swift protocol property in protocol - Candidate has non-matching type
问题 I have a protocol (ProtocolA) containing a single property conforming to a second protocol (ProtocolB). public protocol ProtocolA { var prop: ProtocolB? { get } } public protocol ProtocolB { } I'm trying to declare two classes that will implement those: private class ClassA : ProtocolA { var prop: ClassB? } private class ClassB : ProtocolB { } But I get an error: Type 'ClassA' does not conform to protocol 'ProtocolA' Protocol requires property 'prop' with type 'ProtocolB?' Candidate has non