title: scala syntax to match on multiple case class types without decomposing the case class
body: <p>I have a sealed trait with various case class implementations. I want to pattern match on multiple classes at once for the same match expression. I can't seem to do it without decomposing the case classes and "|" between them</p>
  
  <p>currently looks like:</p>
  
  <pre><code>sealed trait MyTrait {
    val param1: String
    ...
    val param100: String
  }
  
  case class FirstCase(param1: String ...... param100: String) extends MyTrait
  ...
  case class NthCase(param1: String ..... param100: String) extends MyTrait
  </code></pre>
  
  <p>another place in code:</p>
  
  <pre><code>def myFunction(something: MyTrait) = {
     ...
     val matchedThing = something match {
        // this doesn't work with "|" character
        case thing: FirstCase | SecondCase =&gt; thing.param1
        ...
        case thing: XthCase | JthCase =&gt; thing.param10
     }
  } 
  </code></pre>