7d62f0b5aa
Creating a new array (and copying data into it with System.arraycopy) doesn't work in generic case, because the actual array class depends on call site.
14 lines
322 B
Kotlin
Vendored
14 lines
322 B
Kotlin
Vendored
// TARGET_BACKEND: JVM
|
|
|
|
fun box(): String =
|
|
object : A<Void, Void>() {
|
|
override fun f(vararg params: Void): Void? = null
|
|
}.execute()
|
|
|
|
abstract class A<P, R> {
|
|
protected abstract fun f(vararg params: P): R?
|
|
|
|
fun execute(vararg params: P): String =
|
|
if (f(*params) == null) "OK" else "Fail"
|
|
}
|