[JS BE] Support passing an array as argument of vararg in named form
#KT-38059 fixed
This commit is contained in:
+8
-4
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user