cy
<T : A>
T
B
data class X(val ... ) : A { } fun f(): X = B().doSomething() // here T is X but you return B