Possible duplicate:
Using comparison operators in Scala pattern matching
For the method below, I get the error: "'=>' the expected but integer literal was found."
It is not possible to check if x is larger than another number, or is there an alternative approach for returning "greater than 2" if "> 2" matches?
def describe(x: Any) = x match { case 5 => "five" case > 2 => "greater than 2" }
source share