You can do:
code match {
case "1" | "2" => // whatever
case "3" =>
}
Note that you cannot bind parts of the pattern to names – you can’t do this currently:
code match {
case Left(x) | Right(x) =>
case null =>
}
You can do:
code match {
case "1" | "2" => // whatever
case "3" =>
}
Note that you cannot bind parts of the pattern to names – you can’t do this currently:
code match {
case Left(x) | Right(x) =>
case null =>
}