Is MethodHandle support coming? (When is Java 8 support expected?)


As I learned several month ago, Kotlin 1.1 is no longer a Kotlin version that’s expected to support Java 8 language features. Do we know yet when Kotlin is expected to finally catch up?

I unfortunately just spent some time debugging some more issues that are apparently caused by the lack of Java 8 support: MethodHandles can’t be efficiently invoked directly from Kotlin code. :\

The answer Dmitry gave here to someone having problems with
MethodHandle in Kotlin — while a very good guess as to the issue the user was experiencing — actually wasn’t the root of the problem the user was having (as is demonstrated here). The problem is this: polymorphic signature support.

Is there a new version number or time period expected for Java 8 support in Kotlin?


Polymorphic signature support is not on the roadmap for Kotlin 1.2, and we haven’t done any planning for versions beyond 1.2 at this time.


“Java 8 support” is quite a large topic. Some things added in Java 8 are supported already, and 1.1 starts generating class files with the Java 8 version number. I guess the next priority is to start using Java 8 bytecode features, in particular, invokedynamic for on-the-fly lambda class generation.

For the case of invoking MethodHandles I guess you would just use Java for now. It’s a pity, but that is such a niche feature I can see why it’s not prioritised.


And by the way we accept pull requests, and I think that a feature like this one could be a great external contribution.