KT-1360 Vararg bug in front-end

This commit is contained in:
Andrey Breslav
2013-01-31 18:33:23 +04:00
parent 1fcbf1721b
commit bbde38a6dc
5 changed files with 70 additions and 25 deletions
@@ -0,0 +1,16 @@
fun foo(a: Int, vararg b: Int, f: (IntArray) -> String): String {
return "test" + a + " " + f(b)
}
fun box(): String {
val test1 = foo(1) {a -> "" + a.size}
if (test1 != "test1 0") return test1
val test2 = foo(2, 2) {a -> "" + a.size}
if (test2 != "test2 1") return test2
val test3 = foo(3, 2, 3) {a -> "" + a.size}
if (test3 != "test3 2") return test3
return "OK"
}