Files
kotlin/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt
Anton Bannykh a62fbd7fa1 JS: fix explicit cross-module SAM constructor calls
(cherry picked from commit bd2a0563ad)
2020-06-06 17:48:45 +03:00

21 lines
393 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument
// IGNORE_BACKEND_FIR: JVM_IR
// SKIP_DCE_DRIVEN
fun interface MyRunnable {
fun run()
}
fun box(): String {
var result = "failed"
val r = MyRunnable { result += "K" }
foo({ result = "O" }, r)
return result
}
fun foo(vararg rs: MyRunnable) {
for (r in rs) {
r.run()
}
}