title: scala pattern matching nested cases
body: <p>I try to <code>match</code> after some <code>case</code> applied. Kind of <code>nested cases/matches</code>:</p>
  
  <pre><code>val x1 = 2 // or 1, 3 ...
  val str = x1 match {   // scala.MatchError: 1 (of class java.lang.Integer)
  
    case x if(x &gt; 1) =&gt; "x"+x match {case "x1" =&gt; "yes"}
  
    // updated:
    case _ =&gt; "nope"
  }
  println (str)
  </code></pre>
  
  <p>It fails with <code>scala.MatchError</code> exception.</p>
  
  <p>Is it possible? It seems I've seen something similar.</p>
  
  <blockquote>
    <p>Exception in thread "main" scala.MatchError: x2 (of class
    java.lang.String)     at
    pattern_matching.PatternMatchingTest$delayedInit$body.apply(PatternMatchingTest.scala:32)
      at scala.Function0$class.apply$mcV$sp(Function0.scala:40)   at
    scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
      at scala.App$$anonfun$main$1.apply(App.scala:71)    at
    scala.App$$anonfun$main$1.apply</p>
  </blockquote>