You should think twice any time you catch yourself using a type or type variable in a pattern match, first because type erasure means it's not likely to work, and second because parametricity means it shouldn't. There's almost always a better solution.
In this case you could do something like the following:
class Foo[T] { }
val input = (new Foo[String], new Foo[String])
def doSomething[A](pair: (Foo[A], Foo[A])) = ???
Now doSomething(input)
will compile, but doSomething((new Foo[Char], new Foo[Int]))
won't (assuming you leave the type parameter on Foo
invariant). There's still not a lot you can (honestly) do with the items in the pair, since you only know that they have the same type, so usually you'll want to add something like a type class constraint, and using a method also helps in that respect.