WASM: Implement spread operator

This commit is contained in:
Igor Laevsky
2021-06-27 15:04:12 +03:00
committed by teamcityserver
parent f5e59194b5
commit d835b3c164
22 changed files with 282 additions and 68 deletions
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: SPREAD_OPERATOR
fun booleanVararg(vararg xs: Boolean) {
if (xs.size != 1 && xs[0] != true) throw AssertionError()
}
-2
View File
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: SPREAD_OPERATOR
// !LANGUAGE: +AllowAssigningArrayElementsToVarargsInNamedFormForFunctions
fun test(vararg s: String) = s[1] + s.size
-2
View File
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: SPREAD_OPERATOR
fun barB(vararg args: Byte) = args
fun barC(vararg args: Char) = args
fun barD(vararg args: Double) = args
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: SPREAD_OPERATOR
// WITH_RUNTIME
import kotlin.test.*
@@ -1,5 +1,3 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: SPREAD_OPERATOR
fun box(): String {
if (test1() != "") return "fail 1"
if (test1(1) != "1") return "fail 2"