, but it seems that kotlin compiler still produces Function class.
Copy code
fun main() {
val a = 0
l { println(a) }
}
fun l(block: () -> Unit) {
block()
}
Will produce:
Copy code
NEW test/TestMainKt$main$1
public final static l(Lkotlin/jvm/functions/Function0;)V
final class test/TestMainKt$main$1 extends kotlin/jvm/internal/Lambda implements kotlin/jvm/functions/Function0
c
Chris Lee
10/30/2022, 1:05 PM
How is it enabled? In some cases (Gradle ‘kotlin-dsl’ is one) plugins set this in ‘afterEvaluate’.