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:
@@ -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()
|
||||
Reference in New Issue
Block a user