I’ve recently read about lambda implementation in Java and Android (retrolambda) and it seems that retrolambda generates a new anonymous class for every capturing lambda. If lambda is non capturing then it reuses the same instance of the anonymous class. Java 8 is using invokedynamic but behavior is pretty similar - if lambda is capturing it generates a new instance every time. If lambda is non capturing then it reuses it’s instance.
For example:
https://ideone.com/ao81uJ
I’m wondering - how does it work in Kotlin? It’s compatible with Android so I assume that it’s not using invokedynamic, right?