Thanks! I missed that the type changes from Function... to ExtensionFunction....
So basically Kotlin will allow a function to be used as an extension function if the type is ExtensionFunction? Of course I had to try that out in all possible ways. I didn’t succeed creating an extension function in Java, though. There, I have the correct types and interfaces available but I don’t seem to be able to access the result from Kotlin. Is there a way to do that?
But more importantly, I’m wondering about the use cases for declaring extension functions as lambdas. You mention lazy evaluation but I don’t see how that can be the case (as extension functions do not have state of their own). I also can’t imagine that you would want to pass extension functions as a parameter to something else.
Looking at the byte code, you would at least be able to pass such an extension function literal around (because they compile to an instance of ExtensionFunction) whereas “real” extension functions compile to static methods.