title: Get the specific simple name of a generic type in Scala
body: <p>Is it possible to get the type name of a generic class in Scala? I know this isn't possible in Java with type erasure, but I was hoping that Scala would be a different case.</p>
  
  <p>Currently I have to do something similar to this:</p>
  
  <pre><code>trait Model
  case class User(id: String) extends Model
  
  def fromMap[M&lt;:Model : Manifest](data: Map[String, String], modelType: String) = {
    modelType match {
      case "user" =&gt; User(data.get("id").get)
    }
  }
  
  val user = fromMap[User](Map("id" -&gt; "id1"), "user")
  </code></pre>
  
  <p>Obviously it would be easier if I could work out "user" without having to have it passed in.</p>