Files
kotlin-fork/compiler/testData/codegen/box/vararg/notInLastPosition.kt
T
pyos 7c015564ce JVM_IR: do not set ACC_VARARGS if vararg is not the last parameter
Fun fact: this is not actually validated when loading the class; and
even when compiling a java file against a class file that does this,
only javac 9 has a check (1.8 and before simply crashes with
NullPointerException somewhere deep inside the compiler).
2019-11-20 13:40:46 +01:00

16 lines
257 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// FILE: A.kt
class A {
fun f(vararg xs: String, y: String) = xs[0] + y
}
// FILE: B.java
public class B {
public static String f() {
return new A().f(new String[]{"O"}, "K");
}
}
// FILE: C.kt
fun box() = B.f()