I have a strange issue with swift generic protocol. Here is the example code I have:
protocol A {
var s: String? { get }
}
protocol B: A {
var d: Int? { get }
}
protocol Aed {
associatedtype T: A
var a: T! { get }
}
class AClass: Aed {
var a: B!
}
And on line class AClass: Aed {
I'm getting error type 'AClass' does not conform to protocol 'Aed'
. I do not understand why swift unable to infer the type of a, it seems straightforward, no?