Files
kotlin/compiler/testData/codegen/box/vararg/varargInJava.kt
Ilya Matveev a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00

35 lines
584 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// FILE: A.java
public class A {
public int foo(int x, String ... args) {
return x + args.length;
}
public static String[] ar = new String[] { "a", "b"};
}
// FILE: test.kt
fun bar(args: Array<String>?): Int {
var res = 0
if (args != null) {
res += A().foo(1, *args)
}
res += A().foo(1, *A.ar)
return res
}
fun box(): String {
if (bar(null) != 3) return "Fail"
if (bar(A.ar) != 6) return "Fail"
return "OK"
}