iseki
03/22/2020, 5:17 AM<T>
to <Base<T>>
?
open class C<T:C<T>>{
fun <R> foo(a:R){
a as T // looks not works...
}
}
tseisel
03/22/2020, 1:27 PMBase<T>
?tseisel
03/22/2020, 1:30 PMR
to T
is completely unsafe, as there is no defined relationship between T
and R
.
I would have worked with
open class C<T : C<T>> {
fun foo(a: T) {
// a is already a T
}
}