How to differentiate between a bound callable member reference and a function of the same type in kotlin?

When it comes to a method signature or definition, is there any way to differentiate



users().indexOn<User, String> { }

? That is, to specify that a bound member reference is required and not a function instance, or vice versa. Here is the signature of the above example:

fun <T: SomeType, U> indexOn(function: (T) -> U): List<U>

On the same note, is it possible to differentiate between a constructor reference and a function which just returns a type? E.g. query(::SomeLookup) vs. query { SomeLookup(args) } (without kotlin.reflect, if possible)

One way to distinguish a lambda from a function reference within the type system is using the reflection interface KFunction<T>, for example:

fun <T> f(ref: T) where T : () -> Unit, T : KFunction<Unit> { /* ... */ }

fun g() { println("hello") }
f(::g) // OK

f { println("hello") } // Error: type parameter bound is not satisfied

Though I could not make it work the other way around for now.

Also, I found no way to distinguish a constructor reference by its type. At runtime, however, it is easy to do that through reflection: you can check whether a javaConstructor of a KFunction<*> is null.