Serge
11/08/2018, 10:08 PMval o = object{}
val mm = o.javaClass.declaredMethods
and val mm = o::class
val ff = mm.declaredMemberFunctions
but it doesn't return anything. is it possible at all? if so, would the function modifier affect this search (private, public, etc)?udalov
// FILE: test.kt
import kotlin.reflect.jvm.*
fun foo() = "OK"
fun main() {
val functions = (object {}).javaClass.enclosingClass.declaredMethods
val foo = functions.single { it.name == "foo" }.kotlinFunction!!
println(foo.call()) // OK
}
Serge
11/09/2018, 4:37 PM::main.javaMethod!!.declaringClass.declaredMethods.filter { it.name.startsWith("foo") }.map {it-> it.name}