KT-31908 Handle SAM conversion on vararg elements

This commit is contained in:
Dmitry Petrov
2020-06-02 15:54:50 +03:00
parent 343af60cb4
commit 16f175612e
11 changed files with 152 additions and 31 deletions
@@ -0,0 +1,17 @@
// !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()
}
}