prashan
04/03/2024, 3:57 PMEdoardo Luppi
04/03/2024, 4:49 PMprashan
04/03/2024, 6:16 PMswitch
on union types in TS and have exhaustive checking, similar to a when
in kotlinEdoardo Luppi
04/03/2024, 6:22 PMEdoardo Luppi
04/03/2024, 6:23 PMprashan
04/03/2024, 6:25 PMprashan
04/03/2024, 6:26 PMEdoardo Luppi
04/03/2024, 6:30 PMinstanceof
it's good enough. The outputted JS code should set up the prototype chain correctly.prashan
04/03/2024, 6:31 PMprashan
04/03/2024, 6:31 PMMaybe with a series of instanceof it's good enough.
i don't think i follow hereEdoardo Luppi
04/03/2024, 6:34 PMinstanceof
to understand which class we're dealing with?prashan
04/03/2024, 6:34 PMEdoardo Luppi
04/03/2024, 6:34 PMEdoardo Luppi
04/03/2024, 6:35 PMprashan
04/03/2024, 6:37 PMEdoardo Luppi
04/03/2024, 6:49 PMif-elseif
statements with instanceof
.
But the literal discriminator is certainly better.prashan
04/03/2024, 7:56 PMprashan
04/03/2024, 7:56 PMAdam S
04/06/2024, 2:11 PM@Serializable
sealed classes
https://github.com/adamko-dev/kotlinx-serialization-typescript-generator/blob/v0.2.4/docs/polymorphism-sealed.md#sealed-classes