Support inline classes in function signatures in call/callBy

#KT-25664 Fixed
 #KT-26748 Open
 #KT-26765 Open
This commit is contained in:
Alexander Udalov
2018-08-28 19:09:19 +02:00
parent 3e79bd2b0e
commit 3a5de13dd4
17 changed files with 666 additions and 12 deletions
@@ -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"
}