because in Kodein, you'd do `bind<ViewModelFrag...
# announcements
k
because in Kodein, you'd do
bind<ViewModelFragment<MyViewModel>>()
.
bind
is an
inline fun
, and the type param is reified, so
ViewModelFragment<MyViewModel>
gets inlined directly and "ungenericized" in this case, all you have is some type param that extends
T
, so how can you get back the
T
itself? If you do
Copy code
val fragment = ViewModelFragment<MyViewModel>()
fragment.getGenericTClass<MySubViewModel>()
, how will your function be able to get an instance of the
MyViewModel
Class object? You can only do
R::class.java
to get back
MySubViewModel::class.java