title: Kotlin get type of generic class without instance
body: <p>I want go get <code>Type</code> of <code>T</code>, but I can not get it from instance. I have to get it from class parameter, how to do it?</p>
  <pre><code>abstract class ViewModelFragment&lt;T : ViewModel&gt;{
      protected lateinit var mViewModel: T
  
      override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
         mViewModel = ViewModelProviders
                      .of(scope)
                      .get(getGenericTClass())
      // .get(mViewModel.javaClass) // not working either
  
     }
  
     inline fun&lt;reified R&gt; getGenericTClass() = R::class.java
  
  }
  </code></pre>
  <p>Right now compiler complains</p>
  <blockquote>
  <p>Cannot use 'T' as refined class type. Use Class instead.</p>
  </blockquote>
  <p>I've tried to use solution from <a href="https://stackoverflow.com/a/34463352/2163045">this answer</a> but it's not working for me</p>