mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
21 lines
393 B
Kotlin
Vendored
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()
|
|
}
|
|
}
|