Kotlin does not allow my subclass to pass vararg to my super class constuctor Here is my Operation class:
package br.com.xp.operation
import java.util.ArrayList
abstract class Operation(vararg values: Value) : Value {
protected var values: MutableList<Value> = ArrayList()
internal abstract val operator: String
}
and here is my SubtractionOperation class:
package br.com.xp.operation
class SubtractionOperation private constructor(vararg values: Value) : Operation(values) {
override val operator: String
get() = "-"
}
The compile says:
Type mismatch Required Value found Array
Can anyone explain why this is not possible?