sandwwraith
05/29/2019, 2:35 PM@Polymorphic
annotation, SerializersModule, etc). We have plans to improve it in future.Paul Woitaschek
05/29/2019, 5:16 PMPaul Woitaschek
05/29/2019, 5:18 PMPaul Woitaschek
05/31/2019, 9:17 AMsandwwraith
05/31/2019, 9:17 AM@Polymorphic
annotation is applied automatically for abstract classes, but not for sealed onesPaul Woitaschek
05/31/2019, 11:30 AMPaul Woitaschek
05/31/2019, 11:30 AM@Serializable
@Polymorphic
sealed class BaseSealed {
@Serializable
@Polymorphic
data class Child(val a: String) : BaseSealed()
}
Doesn't work eithersandwwraith
05/31/2019, 1:57 PM@Polymorphic
should be applied on a use-site for sealed class: https://github.com/kotlin/kotlinx.serialization/blob/45aa7c7ab97f25f205408b46a7069886408bce6b/runtime/commonTest/src/kotlinx/serialization/features/SealedPolymorphismTest.kt#L26
Because special support for sealed classes would be introduced in compiler plugin, we do not apply polymorphic for sealed classes globallysandwwraith
05/31/2019, 1:57 PMPolymorphicSerializer(BaseSealed::class)
as its serializer to enable polymorphismPaul Woitaschek
05/31/2019, 7:18 PMsandwwraith
06/03/2019, 11:20 AMPaul Woitaschek
06/04/2019, 4:50 AM