Duplicate cases in pattern matching are unreachable and are usually the result of human error. Because such cases are unreachable, they have the potential to affect the overall control-flow and the behaviour of the program. It is suggested that you remove such duplicate cases.
someVar match {
case foo => ...
case bar => ...
case baz => ...
case foo => ... // This case is unreachable!
}
someVar match {
case foo => ...
case bar => ...
case baz => ...
}