I am trying to do a match on a value based on its type, and there is a case where the expected type is a generic, like below:
def foo(bar: Matchable) = bar match
case (bar: Vector[String]) => println(bar.mkString(","))
However, I get the following warning at runtime:
the type test for Vector[String] cannot be checked at runtime
Why cannot it be checked and how could I overcome this?