title: Get reified type parameter kclass of reified generic type
body: <p>Given a reified type parameter <code>T</code>, if that type is a <code>List</code>, how can I get the list's item type?</p>
  <p>I tried overloading the reified method with <code>T : Any</code> and <code>T : List</code> and also <code>TItem : Any, TList: List&lt;TItem&gt;</code> but that doesn't compile due to conflicting overloads.</p>
  <p><em><strong>Fails to compile, conflicting overloads</strong></em></p>
  <pre><code>inline fun &lt;reified T&gt; getRequiredVariable(variableName: String) =
    // ... implementation
  
  inline fun &lt;reified TItem, reified TList : List&gt; getRequiredVariable(variableName: String) =
    // ... implementation
  </code></pre>
  <p><em><strong>Failed workaround attempt</strong></em></p>
  <pre class="lang-kotlin prettyprint-override"><code>inline fun &lt;reified T : Any&gt; getRequiredVariable(variableName: String) =
      if (T::class.isSubclassOf(List::class)) {
          val tKClass = T::class
          val itemType = tKClass.typeParameters[0] // Won't work, even though T is reified, the type parameter apparently is not
          val itemClassifier = itemType.createType().classifier
          val itemKClass = itemClassifier as KClass&lt;*&gt; // Fails, KTypeParamaterImpl is not KClass&lt;*&gt;
          getRequiredListVariable(variableName, itemKClass) as? T
      } else {
          getRequiredVariable(variableName, T::class)
      }
  </code></pre>