Support @Serializable(ContextualSerializer) on class

It was fixed some time ago (https://github.com/Kotlin/kotlinx.serialization/issues/957)
but for some reason only for old backend.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1776
This commit is contained in:
Leonid Startsev
2022-09-22 18:29:06 +02:00
committed by Space
parent 1967c49914
commit a20ce06102
4 changed files with 29 additions and 0 deletions
@@ -0,0 +1,16 @@
// TARGET_BACKEND: JVM_IR
// WITH_STDLIB
import kotlinx.serialization.*
@Serializable(with = ContextualSerializer::class)
class Ref(
val id: String,
)
fun box(): String {
val kind = Ref.serializer().descriptor.kind.toString()
if (kind != "CONTEXTUAL") return kind
return "OK"
}