[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,5 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
fun returnNullable(): String? = null
inline fun Array<String>.matchAll(fn: (String) -> Unit) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun concatNonNulls(strings: List<String?>): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun for_int_range(): Int {
var c = 0
for (i in 1..10) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun foo(): List<String>? = listOf("abcde")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun for_int_range(): Int {
var c = 0
loop@ for (i in 1..10) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box(): String {
var x = 0
do x++ while (x < 5)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val alist = arrayListOf(1, 2, 3) // : j.u.ArrayList<k.Int>
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val alist = arrayListOf(1 to 2, 2 to 3, 3 to 4)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
var xs = intArrayOf(1, 2, 3)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.3
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
class Del<T>(var x: T) {
operator fun getValue(thisRef: Any?, kProp: Any) = x
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
var xs: IntArray = intArrayOf(1, 2, 3)
get() = field
set(ys) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String {
val a = arrayOfNulls<Int>(5)
var i = 0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String {
val b : Array<Int?> = arrayOfNulls<Int> (5)
var i = 0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun box() : String {
val a = IntArray (5)
var i = 0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// See https://youtrack.jetbrains.com/issue/KT-22424
// IGNORE_BACKEND: JS
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = byteArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = byteArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = intArrayOf()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = intArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = intArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = arrayOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = shortArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val arr = shortArrayOf(10, 20, 30, 40)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d")
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
val xs = listOf("a", "b", "c", "d").asSequence()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun f(x: Any?): Any? {
if (x is Array<*>) {
for (i in x) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
fun printlnMock(a: Any) {}
public fun testCoalesce() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// WITH_RUNTIME
fun box(): String {
val a = arrayListOf<String>()