How to case match a type variable enclosed in a generic type?
问题 I'm writing a Scala subroutine to construct a TypeTag[Map[_<: A, _<: B]] from 2 typetags: tag1: TypeTag[Iterable[_<: A]] tag2: TypeTag[Iterable[_<: B]] The upperbound is necessary because both A and B are declared as covariant, yet TypeTag[T] is invariant. I'm trying to use case match to get implicit type variables of A and B, but found that type pattern match in Scala is relatively week. Namely, the folloing code fails to be compiled: (tag1, tag2) match { case (tt1: TypeTag[Iterable[t1]],