Support inline classes in function signatures in call/callBy
#KT-25664 Fixed #KT-26748 Open #KT-26765 Open
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR, JS, NATIVE
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.jvm.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
inline class S(val value: String)
|
||||
|
||||
fun S.foo(x: Int, s: S): S = this
|
||||
|
||||
/* TODO: Support calling members of inline classes in reflection (KT-26748)
|
||||
inline class T(val s: S) {
|
||||
fun bar(u: S): T = this
|
||||
}
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(listOf(String::class.java, Int::class.java, String::class.java), S::foo.parameters.map { it.type.javaType })
|
||||
assertEquals(S::class.java, S::foo.returnType.javaType)
|
||||
|
||||
/*
|
||||
assertEquals(listOf(), T::bar.parameters.map { it.type.javaType })
|
||||
assertEquals(String::class.java, T::bar.returnType.javaType)
|
||||
*/
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user