Making var arg kParameters default to empty array no argument given

fixes KT-29969
This commit is contained in:
Mathias Quintero
2020-03-14 10:33:41 +01:00
committed by Alexander Udalov
parent b1dbacf45f
commit 34a64d9171
9 changed files with 118 additions and 0 deletions
@@ -0,0 +1,19 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS, NATIVE
// WITH_REFLECT
import kotlin.test.assertEquals
fun join(vararg strings: String) = strings.toList().joinToString("")
fun sum(vararg bytes: Byte) = bytes.toList().fold(0) { acc, el -> acc + el }
fun box(): String {
val j = ::join
val s = ::sum
assertEquals("", j.callBy(emptyMap()))
assertEquals(0, s.callBy(emptyMap()))
return "OK"
}