Fudge
06/27/2019, 7:59 AM@Serializable(InlineSerializer::class)
class Inlined(val str :String)
fun main(){
val obj = Inlined("test")
val str = json.stringify(Inlined.serializer(),obj)
assertEquals("\"test\"",str) // And not {"str":"test"}
}
Toddobryan
06/27/2019, 8:08 AMInlined
and not just a String
.Toddobryan
06/27/2019, 8:09 AMencoder.encodeString(obj.str)
in a custom serializer.Paulius Ruminas
06/27/2019, 8:21 AMSerializable
.
Cause: org.jetbrains.kotlin.codegen.ErasedInlineClassBodyCodegen cannot be cast to org.jetbrains.kotlin.codegen.ImplementationBodyCodegen
Fudge
06/27/2019, 8:38 AMPaulius Ruminas
06/27/2019, 8:39 AMinline
modifier I did not see that.