I have some issues with protocol conformance in Swift. I thought that a protocol inheriting from another protocol automatically conforms to its base protocol. But apparently that's not the case. I expected the following code to work, but it gives me the error message: possibly intended match 'SomeClass.SomeType' (aka 'AnotherProtocol') does not conform to 'SomeProtocol’
protocol SomeProtocol {}
protocol AnotherProtocol: SomeProtocol {}
protocol RequiredProtocol {
associatedtype SomeType: SomeProtocol
}
class SomeClass: RequiredProtocol {
typealias SomeType = AnotherProtocol
}
So, what's the use of protocol inheritance when the conformance is not inherited? And what would be the workaround in this case?