I have a class Operator[T: TypeTag : ClassTag]
and in of it's methods, I want to use Scala's pattern matching on the parameterized type T
. I know how pattern matching works and so tried the following in Scala's repl and got an error.
scala> def matchTest() = T match {
| case x: String => "abcd"
| case _ => null
| }
<console>:11: error: not found: value T
def matchTest() = T match {
^