Is there any way to do this?
@Codable
class A {
var name : String
}
@Codable
class B : A {
var location : String
}
@Codable
class Container {
var elements[A] = [ B() ]
}
How do I annotate this so that when Container is decoded the correct instances of A/B are instantiated?
I got dynamic coding with a protocol working but I'd rather not use that. It seems it only works with protocols and enums?
I could code it by hand to work, but it seems the purpose of MetaCodable is to make something like this easy.