Aladdin - Scala Bugtracking
[#442] project: compiler priority: medium category: missing feature
submitter assigned to status date submitted
Gilles Burak noise 2005-06-10 16:24:44.0
subject Type parameters in patterns
code
abstract class X;
class A[T] extends X;
object Test with Application {
	def y (a:X) = a match {
		case x:A[Int] => 4
		case x:A[Boolean] => 5
	}
	Console.println(y(new A[Boolean]));
}
what happened
Printed 4
what expected Error: Type parameters cannot be used in pattern (lost during erasure).
[back to overview]
Changes of this bug report
Burak  edited on  2005-06-10 16:51:05.0
use
-Xrtt
in order to enable runtime type checks