80ad6a4cd7
- Add IrPluginContext to JvmBackendContext, so plugin intrinsics can reference external functions properly. - Do not use module.findClassAcrossModuleDependencies as Descriptor API does not work for FIR. - Add asm listing tests in serialization plugin for K2 - Remove Delegated.kt asm listing test as we have similar test in boxIr group. #KT-56553 Fixed
24 lines
559 B
Kotlin
Vendored
24 lines
559 B
Kotlin
Vendored
// TARGET_BACKEND: JVM_IR
|
|
|
|
// WITH_STDLIB
|
|
|
|
import kotlinx.serialization.*
|
|
import kotlinx.serialization.json.*
|
|
import kotlinx.serialization.encoding.*
|
|
import kotlin.reflect.typeOf
|
|
|
|
@Serializable
|
|
data class Holder<T>(
|
|
val ok: Boolean,
|
|
@Contextual
|
|
val result: T?
|
|
)
|
|
|
|
fun box(): String {
|
|
val serializer = serializer(typeOf<Holder<List<String>>>())
|
|
val instance = Holder(true, listOf("a", "b"))
|
|
val encoded = Json.encodeToString(serializer, instance)
|
|
if (encoded != """{"ok":true,"result":["a","b"]}""") return encoded
|
|
return "OK"
|
|
}
|