JP Sugarbroad
05/02/2025, 9:53 PMopen class Super
class Container<T: Super>
fun test(thing: Any) {
if (thing is Container<*>) {
val thing2 = thing as Container<Super>
}
}
But this does not?
open class Super
class Container<T: Super>
fun test(thing: Any) {
if (thing is Container<out Super>) {
val thing2 = thing as Container<Super>
}
}
Shouldn't *
be equivalent to out Super
in this case?loke
05/03/2025, 7:38 AMis
on an erased type.loke
05/03/2025, 7:40 AMContainer
.JP Sugarbroad
05/05/2025, 12:01 PM