Having trouble coming up with an explanation, but ...
# announcements
p
Having trouble coming up with an explanation, but maybe this code will help. You can call
doSomething
on an instance of
B
without expecting to get a
B
back.
Copy code
data class C(val str: String) : A {
    override fun <T : A> doSomething(): T { TODO() }
}

val c: C = B(“foo").doSomething<C>()