Generate sam wrappers in inlined lambda in same way as in inline function
#KT-24825 Fixed
This commit is contained in:
+39
@@ -0,0 +1,39 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
public static void run(Runnable l) {
|
||||
l.run();
|
||||
}
|
||||
|
||||
public static void s(Runnable a, Runnable onError) {
|
||||
a.run();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
var state = ""
|
||||
|
||||
fun unit() {}
|
||||
|
||||
class B {
|
||||
val s = mutableListOf<Unit>()
|
||||
|
||||
init {
|
||||
s.add(JavaClass.s({ state += "O" }, ::unit))
|
||||
|
||||
Any().apply {
|
||||
JavaClass.run {
|
||||
s.add(JavaClass.s({ state += "K" }, ::unit))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
B()
|
||||
return state
|
||||
}
|
||||
Reference in New Issue
Block a user