Travis Griggs
10/23/2019, 3:30 AMvar
to it when/where T is Comparable. The syntax is eluding me. I tried:
var <T : Comparable<T>>Slot.concisely:T
get() = this.value
set(newValue) {
if (this.value != newValue) {
this.value = newValue
}
}
But I’m getting a “Type property of parameter must be used in property type”. What am I missing? I’m guessing a bit at the syntax based this snippet seen in the documentation:
fun <T : Comparable<T>> sort(list: List<T>) { ... }