Files
kotlin-fork/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt
T
2020-07-10 11:30:42 +03:00

20 lines
374 B
Kotlin
Vendored

// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument
// IGNORE_BACKEND_FIR: JVM_IR
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()
}
}