I'd like to do something like this:
case class D[X <: A](arg1 : X, arg2: Int) extends X {
}
D is kind of a decorator class for arg1, and I'd like to apply it to several different kinds of things that are subclasses of A.
However I get this error:
scala> case class D[X <: A](arg1 : X, arg2: Int) extends X { override val name = "D"; } :6: error: class type required but X found
If not, is there a more scalaish way to do this kind of thing?