I plan to set my coordinator if only it is type T sent.
interface ViewSurface<T : Coordinator> {
var coordinator: T
fun setCoor(coordinator: Coordinator) {
if (coordinator is T) {
this.coordinator = coordinator
}
}
}
The above code complaint Cannot check for erased type: T
. How could I change to get the right syntax yet achieve what I wanted?