groostav
11/05/2024, 6:04 AMval x = fun(arg: String) { println(arg) }
val functionRef: KFunction<*> = x::invoke //valid, i can create a reflective handle to invoke.
x::class.members // 6 entries, 2 each of equals, hashcode, tostring. invoke is missing
is this expected behaviour?ephemient
11/05/2024, 3:39 PMephemient
11/05/2024, 3:40 PMephemient
11/05/2024, 3:43 PMx::class.supertypes // [kotlin.Any]
is empty, which is definitely wrong if you compare it to
listOf(x::class.java.superclass) + x::class.java.interfaces // [class java.lang.Object, interface kotlin.jvm.functions.Function1]
ephemient
11/05/2024, 3:43 PMinvoke
probably stems from thatephemient
11/05/2024, 5:17 PMx.reflect()
for which x.reflect()!!::class.members
will contain the correct invoke
(and also many incorrect `invoke`s)