[JS IR BE] Arrays, varargs

This commit is contained in:
Anton Bannykh
2018-09-12 14:31:22 +03:00
parent e24f68c357
commit 2e709a81fa
470 changed files with 761 additions and 585 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun booleanVararg(vararg xs: Boolean) {
if (xs.size != 1 && xs[0] != true) throw AssertionError()
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun aa(vararg a : String): String = a[0]
fun box(): String {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun barB(vararg args: Byte) = args
fun barC(vararg args: Char) = args
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
operator fun <T> Array<T>?.get(i : Int?) = this!!.get(i!!)
fun <T> array(vararg t : T) : Array<T> = t as Array<T>
@@ -1,5 +1,4 @@
// !LANGUAGE: -ProhibitAssigningSingleElementsToVarargsInNamedForm
// IGNORE_BACKEND: JS_IR
fun box(): String {
if (test1(p = 1) != "1") return "fail 1"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
import kotlin.test.*
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
if (test1() != "") return "fail 1"
if (test1(1) != "1") return "fail 2"
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun foo(a: Int, vararg b: Int, f: (IntArray) -> String): String {
return "test" + a + " " + f(b)
}