Modularising to create a function with variable Types in Kotlin

I have posted that question there. I would like to generalize the BaseViewModel with te tricky case where the variable contains something like Class::class.java, or clazz:Class<T>