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).
This commit is contained in:
pyos
2019-11-20 12:06:17 +01:00
committed by max-kammerer
parent 7adffe0007
commit 7c015564ce
6 changed files with 36 additions and 1 deletions
@@ -0,0 +1,15 @@
// 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()