title: How to express `Class<? extends Any>`
body: <p>I'm trying to write something like this:</p>
  
  <pre><code>var classList = ArrayList&lt;Class&lt;Any&gt;&gt;()
  init {
      classList.add(ClassA::class.java)
      classList.add(ClassB::class.java)
  }
  </code></pre>
  
  <p>That gets me errors like:</p>
  
  <pre><code>Type inference failed. Expected type mismatch: inferred type is Class&lt;ClassA&gt; but Class&lt;Any&gt; was expected
  </code></pre>
  
  <p>I can get rid of the error by doing an explicit cast:</p>
  
  <pre><code>domainClasses.add(NameIdMapping::class.java as Class&lt;Any&gt;)
  </code></pre>
  
  <p>That gets me an "unchecked cast" warning.  Is that the best I can do? How to do this cleanly?</p>