mardi 29 décembre 2015

Scala instance-of on typed parameter with TypeTag?

Can I implement the following method:

// returns weather `v` is instance of `A`
def isItOfType[A](v: Any) = ???

With TypeTag?
Or do I have to use ClassTag (classsTag[A].runtimeClass.isInstance(v))?





Aucun commentaire:

Enregistrer un commentaire