How to perform pattern matching for multiple types in scala ?
I am looking to achieve something like below where pattern match type of a and b and execute the code for the combination of type.
def equals[T](a: T, b: T) = {
(a,b) match {
case (a,b) : (String, String) = isEquals(a.asInstanceOf[String],b.asInstanceOf[String])
case (a,b) : (Int, Int) = isEquals(a.asInstanceOf[Int],b.asInstanceOf[Int])
}
}