Files
kotlin-fork/compiler/testData/codegen/box/reflection/callBy/emptyVarArg.kt
T
2021-11-15 19:53:49 +03:00

20 lines
449 B
Kotlin
Vendored

// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// IGNORE_BACKEND: JS, NATIVE, WASM
// 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"
}