title: Scala type erasure in pattern matching Map[String, Int]
body: <p>In <code>Scala 2.10</code>, the compiler warns the given code:</p>
  
  <pre><code>  private def getStrFromOpt[T](opt: Option[T]): String = opt match {
      case Some(s: String) =&gt; s
      case Some(i: Int) =&gt; i.toString()
      case Some(l: Long) =&gt; l.toString()
      case Some(m: Map[String, Int]) =&gt; m map ({ case (k, v) =&gt;
        "(" + k + ", " + v + ")" }) mkString ("(", ", ", ")")
      case _ =&gt; ""
    }
  </code></pre>
  
  <p>with the message <code>non-variable type argument String in type pattern Map[String,Int] is unchecked since it is eliminated by erasure: case Some(m: Map[String, Int]) ...</code>.</p>
  
  <p>How can I get rid of this warning? What if I will have a <code>Map[String, MyObj]</code> which I want to include as a case in this matching - how can I distinguish the two cases with parameterised Maps?</p>