JVM IR: Don't generate line numbers and null checks in SAM wrapper constructors

This commit is contained in:
Steven Schäfer
2020-11-02 14:40:08 +01:00
committed by Alexander Udalov
parent 68e2d0d245
commit 8574cb4466
7 changed files with 61 additions and 5 deletions
@@ -0,0 +1,24 @@
// FILE: J.java
public class J {
public static void g(Runnable r) {
r.run();
}
}
// FILE: test.kt
fun nonInlineFun() {
val f = {}
J.g(f)
}
inline fun inlineFun() {
val f = {}
J.g(f)
}
// The SAM wrapper constructor is public inside of inline functions.
// It has no other flags. In particular, it is not synthetic.
// 1 access flags 0x0\n\s*<init>\(Lkotlin/jvm/functions/Function0;\)V
// 1 access flags 0x1\n\s*public <init>\(Lkotlin/jvm/functions/Function0;\)V