Erase generics before comparing supertypes.