A workaround would be to define a KFunction delega...
# reflect
r
A workaround would be to define a KFunction delegate:
Copy code
class BoundFunction<R>(val instance : Any, val baseFunction : KFunction<R>) : KFunction<R> by baseFunction {
    override fun call(vararg args: Any?): R =
            baseFunction.call(*(listOf(instance) + args.asList()).toTypedArray())

    override fun callBy(args: Map<KParameter, Any?>): R =
            baseFunction.callBy(mapOf(Pair(baseFunction.instanceParameter!!, instance)) + args)

    override val parameters: List<KParameter>
        get() = listOf(baseFunction.instanceParameter!!) + baseFunction.parameters
}
which probably has issues, so this seems non-trivial enough that would warrant support in the API