Files
kotlin-fork/compiler/testData/codegen/boxAgainstJava/varargs/varargsOverride2.kt
T
Mads Ager 1ecf5943ab [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.
2020-11-13 12:13:53 +01:00

22 lines
384 B
Kotlin
Vendored

// FILE: A.java
public abstract class A<T> {
protected abstract String doIt(T... args);
public <S extends T> String test(S... args) {
return doIt(args);
}
}
// FILE: 1.kt
open class Super
class Sub: Super()
val a: A<Super> =
object : A<Super>() {
override fun doIt(vararg parameters: Super): String = "OK"
}
fun box(): String = a.test<Sub>()