Pattern matching is not working as per the understanding.
I read the pattern matching concepts in the text book "Programming in Scala".
I have a pattern matching definition as below.
def checkMe (a:Any) = a match {
case Int => "I am an Integer"
case Double => "I am a Double"
case Char => "I am a Charecter"
case _ => "I am something else"
}
Irregardless whatever I pass while calling to the function, always the default case is executed.
E.g: checkMa(100) gives "I am something else" checkMe(10.) too gives "I am something else" etc..
Can someone please help me understand what is wrong in the definition.
I expect the definition executing according to the type I pass.