Files
kotlin-fork/plugins/kotlinx-serialization/testData/boxIr/sealedClassMultifile.kt
T
Leonid Startsev fba2f5ea4e Expand most kotlinx.serialization tests on JS backend
to enhance and increase test coverage of the plugin.
2024-01-10 12:17:34 +00:00

27 lines
465 B
Kotlin
Vendored

// WITH_STDLIB
// FILE: a.kt
import kotlinx.serialization.*
@Serializable
sealed class Base {
abstract val id: Long
}
// FILE: b.kt
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.*
@Serializable
class DerivedOtherFile<Value>(
override val id: Long,
val value: Value
) : Base()
fun box(): String {
val desc = Base.serializer().descriptor.kind
return if (desc == PolymorphicKind.SEALED) "OK" else desc.toString()
}