Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/reflection/mapping/inlineReifiedFun.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

24 lines
441 B
Kotlin

// IGNORE_BACKEND: JS
// WITH_REFLECT
import kotlin.reflect.*
import kotlin.reflect.jvm.*
import kotlin.test.assertEquals
inline fun <reified T> f() = 1
fun g() {}
class Foo {
inline fun <reified T> h(t: T) = 1
}
fun box(): String {
assertEquals(::g, ::g.javaMethod!!.kotlinFunction)
val h = Foo::class.members.single { it.name == "h" } as KFunction<*>
assertEquals(h, h.javaMethod!!.kotlinFunction)
return "OK"
}