[JVM_IR] Determine correct type of empty varargs array.
When calling vararg methods with a generic vararg type without passing explicit parameters, we have to allocate an empty array of the right type. We failed to do so previously, as we did not take the type arguments for the dispatch receiver into account.
This commit is contained in:
committed by
Alexander Udalov
parent
ffc003c051
commit
1ecf5943ab
@@ -0,0 +1,18 @@
|
||||
// FILE: A.java
|
||||
|
||||
public abstract class A<T> {
|
||||
protected abstract String doIt(T... args);
|
||||
|
||||
public String test(T... args) {
|
||||
return doIt(args);
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
val a: A<Void> =
|
||||
object : A<Void>() {
|
||||
override fun doIt(vararg parameters: Void): String = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = a.test()
|
||||
Reference in New Issue
Block a user