Files
kotlin-fork/compiler/testData/codegen/box/funInterface/funConversionInVararg.kt
T
2021-10-02 06:14:35 +00:00

21 lines
405 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: SAM_CONVERSIONS
// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument
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()
}
}