mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
35 lines
576 B
Kotlin
Vendored
35 lines
576 B
Kotlin
Vendored
// TODO: muted automatically, investigate should it be ran for JS or not
|
|
// IGNORE_BACKEND: JS
|
|
|
|
// 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"
|
|
}
|