`fun <T : Any?> foo(): T` is possible. Sinc...
# announcements
d
fun <T : Any?> foo(): T
is possible. Since you specified that T is nullable then that's happening somewhere. You could also write
fun <T : Any> foo(): T
which doesn't allow for a nullable T