bjonnh
03/18/2021, 7:52 PMdata class Vega(
val background: StringOrMoreComplex
)
ephemient
03/18/2021, 7:52 PMbjonnh
03/18/2021, 7:53 PMbjonnh
03/18/2021, 7:53 PMephemient
03/18/2021, 7:53 PM@Serializable
data class Vega<T>(
val background: T
)
you'd have no issues (at least not here). that level of knowing at compile-time?bjonnh
03/18/2021, 7:54 PMbjonnh
03/18/2021, 7:54 PMbjonnh
03/18/2021, 7:55 PMbjonnh
03/18/2021, 7:55 PMephemient
03/18/2021, 7:55 PMephemient
03/18/2021, 7:56 PMbjonnh
03/18/2021, 7:56 PMephemient
03/18/2021, 7:57 PMbjonnh
03/18/2021, 7:57 PMbjonnh
03/18/2021, 7:57 PMbjonnh
03/18/2021, 7:58 PMbjonnh
03/18/2021, 8:02 PMbjonnh
03/18/2021, 8:06 PMbjonnh
03/18/2021, 8:17 PMbjonnh
03/18/2021, 8:17 PMbjonnh
03/18/2021, 8:23 PMbjonnh
03/18/2021, 8:23 PMbjonnh
03/18/2021, 8:25 PMephemient
03/18/2021, 8:34 PMbjonnh
03/18/2021, 8:35 PMbjonnh
03/18/2021, 8:36 PMbjonnh
03/18/2021, 8:38 PMephemient
03/18/2021, 8:38 PMtry { decoder.decodeString()
can cause issues as the decoder isn't rewindablebjonnh
03/18/2021, 8:39 PMbjonnh
03/18/2021, 8:39 PMephemient
03/18/2021, 8:39 PMbjonnh
03/18/2021, 8:40 PMbjonnh
03/18/2021, 8:40 PMbjonnh
03/18/2021, 8:40 PMephemient
03/18/2021, 8:41 PMephemient
03/18/2021, 8:41 PMbjonnh
03/18/2021, 8:41 PMbjonnh
03/18/2021, 8:41 PMephemient
03/18/2021, 8:44 PMbjonnh
03/18/2021, 8:50 PMbjonnh
03/18/2021, 8:50 PMbjonnh
03/18/2021, 9:00 PMbjonnh
03/18/2021, 9:02 PMbjonnh
03/18/2021, 9:02 PMbjonnh
03/18/2021, 9:02 PMephemient
03/18/2021, 9:24 PMbjonnh
03/18/2021, 9:26 PMbjonnh
03/18/2021, 9:27 PMephemient
03/18/2021, 9:35 PM@InternalSerializationApi
then this is doable. also if you use Kotlin 1.5's sealed interface
(usable on Kotlin 1.4.3x if you add kotlinOptions.languageVersion = "1.5"
) then you can have Signal
in multiple sealed hierarchiesbjonnh
03/18/2021, 9:36 PMbjonnh
03/18/2021, 9:36 PMephemient
03/18/2021, 9:38 PMbjonnh
03/18/2021, 9:41 PMbjonnh
03/18/2021, 9:42 PMbjonnh
03/18/2021, 9:47 PMbjonnh
03/18/2021, 9:47 PMbjonnh
03/18/2021, 9:50 PMbjonnh
03/18/2021, 9:50 PMbjonnh
03/18/2021, 9:55 PMbjonnh
03/18/2021, 10:01 PMbjonnh
03/18/2021, 10:01 PMephemient
03/18/2021, 10:18 PMbuildSerialDescriptor("Name", SerialKind.SEALED)
required @Internal
, but I played around with it and it seems that buildClassSerialDescriptor("Name")
works just fine, public APIephemient
03/18/2021, 10:18 PMbjonnh
03/18/2021, 10:19 PMbjonnh
03/18/2021, 10:19 PMbjonnh
03/18/2021, 10:20 PMbjonnh
03/18/2021, 10:22 PMephemient
03/18/2021, 10:25 PM@SerialName
would work as expectedbjonnh
03/19/2021, 12:31 AMbjonnh
03/19/2021, 12:33 AM