apomelov
08/09/2018, 10:49 AM@Serializable
abstract class Tree(open val health: Int = 100)
@Serializable
class Willow(override val health: Int = 95) : Tree(health)
But I was surprised when saw the JSON:
["Willow",{"health":95,"health":95}]
Actually, I'm not sure it's a valid one... How can I handle inheritance with serialization?sandwwraith
08/09/2018, 11:30 AMapomelov
08/09/2018, 11:31 AMapomelov
08/09/2018, 11:46 AM@Serialization
annotation from parent class. Now I have only one health
, but parent class's fields are not being serialized (not presented in my sample)apomelov
08/09/2018, 12:36 PMsandwwraith
08/09/2018, 12:38 PMapomelov
08/09/2018, 12:40 PMapomelov
08/09/2018, 12:41 PMJonathan Walsh
08/09/2018, 5:40 PMapomelov
08/09/2018, 5:46 PMapomelov
08/10/2018, 8:59 PMVsevolod Tolstopyatov [JB]
08/12/2018, 2:00 PMapomelov
08/12/2018, 2:55 PMVsevolod Tolstopyatov [JB]
08/12/2018, 3:12 PMapomelov
08/12/2018, 3:13 PMVsevolod Tolstopyatov [JB]
08/12/2018, 3:15 PMapomelov
08/12/2018, 3:16 PMsandwwraith
08/13/2018, 9:36 AMClass.forName
on JVM and we don’t have such reflection support in Kotlin/JS. We are working on design that can bypass this limitation for polymorphism (likely, by global registering of all inheritors or something like that)vpriscan
08/15/2018, 11:38 AMapomelov
08/15/2018, 11:47 AM