kevinmost
11/21/2017, 4:59 PMbind<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
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