object Main extends App {
def foo[A](somelist: List[A])(implicit m: Manifest[A]): String = somelist match {
case _ : List[Int] => "we have a list of int!"
case _ => "have no idea what this list is"
}
}
Main.foo(List[String]("somestring"))
results in:
res0: String = we have a list of int!
I was sure the whole purpose of Manifest
was to pass information to the JVM
why doesnt this work? (PS I'm aware TypeTag
is the updated way to do it I want to try it with Manifest
).
thanks