[IR] Support reflection for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com> #KT-1179
This commit is contained in:
committed by
Space Team
parent
1ff4906880
commit
88f293d4a9
+23
@@ -0,0 +1,23 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// WITH_REFLECT
|
||||
// LANGUAGE: +ValueClasses
|
||||
import kotlin.reflect.full.primaryConstructor
|
||||
import kotlin.reflect.jvm.javaConstructor
|
||||
import kotlin.reflect.jvm.kotlinFunction
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@JvmInline
|
||||
value class Z(val x1: UInt, val x2: Int)
|
||||
|
||||
class Test(val x: Z)
|
||||
|
||||
fun box(): String {
|
||||
val kctor1 = Test::class.primaryConstructor ?: throw AssertionError("No primary constructor")
|
||||
val jctor1 = kctor1.javaConstructor ?: throw AssertionError("No javaConstructor for $kctor1")
|
||||
val kctor2 = jctor1.kotlinFunction ?: throw AssertionError("No kotlinFunction for $jctor1")
|
||||
|
||||
assertEquals(kctor1, kctor2)
|
||||
assertEquals("[x]", kctor2.parameters.map { it.name }.toString())
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user