Files
kotlin-fork/plugins/kotlinx-serialization/testData/boxIr/starProjections.kt
T
Leonid Startsev 596949a501 Correctly handle star projections according to logic of the old FE.
#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)
2022-10-12 10:36:26 +00:00

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
}