// TARGET_BACKEND: JVM_IR // WITH_STDLIB import kotlinx.serialization.* import kotlinx.serialization.json.* import kotlinx.serialization.internal.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.modules.* import java.lang.AssertionError import java.lang.IllegalArgumentException interface I @Serializable data class Box(val boxed: T) inline fun getSer(): KSerializer { return serializer() } inline fun getListSer(): KSerializer> { return serializer>() } fun checkBlock(name: String, block:() -> Unit) { try { block() } catch (e: IllegalArgumentException) { if (!e.message!!.contains("Star projections in type arguments are not allowed")) throw e return } throw AssertionError("Expected exception to be thrown in block $name") } fun box(): String { checkBlock("direct") { serializer>() } checkBlock("direct list") { serializer>>() } checkBlock("getSer") { getSer>() } checkBlock("getListSer") { getListSer>() } return "OK" }