Whenever you write generics that only occur in the...
# announcements
k
Whenever you write generics that only occur in the return type you're basically promising the user that they can pick
T
. Now consider this code:
val clazz: KClass<out DownStopController> = position.controllerClass()
That wouldn't work,
KClass<Upstart controller>
isn't a subtype of
KClass<out DownStartController>
.