JVM IR: Use inline SAM wrappers inside of inline lambdas
This commit is contained in:
committed by
Alexander Udalov
parent
f2b8c67962
commit
36711a768b
@@ -0,0 +1,18 @@
|
||||
// FILE: J.java
|
||||
|
||||
public class J {
|
||||
public static void g(Runnable r) {
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(): String {
|
||||
var result = "Fail"
|
||||
val setter = { result = "OK" }
|
||||
1.apply { J.g(setter) }
|
||||
return result
|
||||
}
|
||||
|
||||
// 1 INVOKESPECIAL TestKt\$sam\$i\$java_lang_Runnable\$0.<init> \(Lkotlin/jvm/functions/Function0;\)V
|
||||
Reference in New Issue
Block a user