Open
Description
In scala 2.13.5, the match expression will raise inexhaustive warning for following code
// warning: match may not be exhaustive. It would fail on the following inputs: Error(_, _), Failure(_, _)
parse(freq, "johnny 121") match {
case Success(matched,_) => println(matched)
case NoSuccess(msg,_) => println(s"NoSuccess: $msg")
}
It looks like it's a problem here
An alternative fix is change it to
object NoSuccess {
def unapply(x: NoSuccess) = x match {
case Failure(msg, next) => Some((msg, next))
case Error(msg, next) => Some((msg, next))
}
}
And then may also need to revert commit c1fbc3c
But it will fail binary compatibility check.
see also: scala/bug#12384
Metadata
Metadata
Assignees
Labels
No labels