[JS BE] Support passing an array as argument of vararg in named form

#KT-38059 fixed
This commit is contained in:
Zalim Bashorov
2020-08-28 00:20:51 +03:00
parent 606232a584
commit 9097d0918c
3 changed files with 23 additions and 8 deletions
+8 -4
View File
@@ -1,7 +1,11 @@
// !LANGUAGE: +AllowAssigningArrayElementsToVarargsInNamedFormForFunctions
// IGNORE_BACKEND: JS
fun test(vararg s: String) = s[1]
fun test(vararg s: String) = s[1] + s.size
fun box(): String =
test(s = arrayOf("", "OK"))
fun box(): String {
val r = test(s = arrayOf("aaa", "Bb"))
if (r != "Bb2") return "fail: $r"
return "OK"
}