596949a501
#KT-54297 Fixed Properly substitute surrogate UnitSerializer in the Companion.serializer() function generated on classes that use polymorphic or sealed serializer by default. (Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1692)
21 lines
444 B
Kotlin
Vendored
21 lines
444 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
|
|
// WITH_STDLIB
|
|
|
|
import kotlinx.serialization.*
|
|
import kotlinx.serialization.json.*
|
|
import kotlinx.serialization.descriptors.*
|
|
|
|
interface E
|
|
|
|
@Serializable
|
|
class Box<T: E>(val boxed: T)
|
|
|
|
@Serializable
|
|
class Wrapper(val boxed: Box<*>)
|
|
|
|
fun box(): String {
|
|
val s = Wrapper.serializer().descriptor.elementDescriptors.joinToString()
|
|
return if (s == "Box(boxed: kotlinx.serialization.Polymorphic<E>)") "OK" else s
|
|
}
|