I can't get class A
to auto-synthesize codability below
protocol MyCodableProtocol: Codable { }
class B: MyCodableProtocol { }
class A: Codable {
var foo: MyCodableProtocol = B()
}
cannot automatically synthesize 'Encodable' because 'MyCodableProtocol' does not conform to 'Encodable'
I also get the issue in the more simplified problem
class C: Codable {
var foo: Codable = "foo"
}
Why yields the even more amusing message:
... because 'Codable' (aka 'Decodable & Encodable') does not conform to 'Encodable'
What is going on?