• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This file was automatically generated from polymorphism.md by Knit tool. Do not edit.
2 package example.examplePoly08
3 
4 import kotlinx.serialization.*
5 import kotlinx.serialization.json.*
6 
7 @Serializable
8 sealed class Response
9 
10 @Serializable
11 object EmptyResponse : Response()
12 
13 @Serializable
14 class TextResponse(val text: String) : Response()
15 
mainnull16 fun main() {
17     val list = listOf(EmptyResponse, TextResponse("OK"))
18     println(Json.encodeToString(list))
19 }
20