title: Is there a better way to test the generic type (without type arguments) in Scala?
body: <p>Given I'm using reflection to go through a list of members (giving me <code>runtime.universe.Symbol</code>), how can I check the generic type without the type arguments? In other words, how do I find the members which are <code>List[]</code> generic type, regardless of what the type argument is?</p>
  <p>Currently I'm using this approach which does work, but I'm wondering if there's a better way to do it:</p>
  <pre><code>import scala.reflect.runtime.currentMirror
  
  // ...
  
  val listTypeConstructor = typeOf[List[_]].typeConstructor
  val myListMembers = currentMirror.reflect(MyObject)
    .symbol
    .asClass
    .typeSignature
    .members
    .filter(member =&gt; member.typeSignature.resultType.typeConstructor == listTypeConstructor)
  </code></pre>
  <p>This results in a list of <code>runtime.universe.Symbol</code> of all the <code>List[]</code> members, including any <code>List[String]</code>, <code>List[Int]</code>, etc. as expected.</p>
  <p>The usage of <code>typeOf[List[_]].typeConstructor</code> seems a bit messy to me though. Is this the best way to do this kind of filtering?</p>