Possible Duplicate:
How do I get around type erasure on Scala? Or, why can't I get the type parameter of my collections?
I ran the following code:
scala> var s = new Stack()push(1)
s: scalatest.Stack[Int] = 1
scala> s match { case s : Stack[String] => print("Hello")}
<console>:12: warning: non variable type-argument String in type pattern scalatest.Stack[String] is unchecked since it is eliminated by erasure
s match { case s : Stack[String] => print("Hello")
}
Stack is the class taken from http://www.scala-lang.org/node/129. If I run this code without -unchecked
flag it will print "Hello". Why is that the case?