mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
24 lines
465 B
Kotlin
Vendored
24 lines
465 B
Kotlin
Vendored
// IGNORE_BACKEND: JS, NATIVE
|
|
// 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 as Any?, ::g.javaMethod!!.kotlinFunction)
|
|
|
|
val h = Foo::class.members.single { it.name == "h" } as KFunction<*>
|
|
assertEquals(h, h.javaMethod!!.kotlinFunction as Any?)
|
|
|
|
return "OK"
|
|
}
|