mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Get rid of rewriting of vars in FunctionCodegen::generateMethod, just extracted generateMethodBody instead #KT-19814 Fixed
23 lines
542 B
Kotlin
Vendored
23 lines
542 B
Kotlin
Vendored
// WITH_REFLECT
|
|
// IGNORE_BACKEND: JS, NATIVE
|
|
|
|
import kotlin.reflect.full.declaredMemberFunctions
|
|
import kotlin.reflect.jvm.javaMethod
|
|
import kotlin.test.assertEquals
|
|
|
|
open class Aaa {
|
|
suspend open fun aaa() {}
|
|
}
|
|
|
|
class Bbb {
|
|
suspend fun bbb() {}
|
|
}
|
|
|
|
fun box(): String {
|
|
val bbb = Bbb::class.declaredMemberFunctions.first { it.name == "bbb" }.javaMethod
|
|
assertEquals("bbb", bbb!!.name)
|
|
val aaa = Aaa::class.declaredMemberFunctions.first { it.name == "aaa" }.javaMethod
|
|
assertEquals("aaa", aaa!!.name)
|
|
return "OK"
|
|
}
|