Kotlin不允许我的子类将vararg传递给我的超类构造函数
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?