How can I use a \"match\" statement to identify the value of a class variable? The following is invalid, and I can\'t find an acceptable variant -- other than if ... else i
To consider inheritance:
val what = c match { case q if classOf[Int].isAssignableFrom(q) => "int!" case q if classOf[Float].isAssignableFrom(q) => "float!" }