Complementing irrefutable unapplySeq aren't recognized as exhaustive #12252
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
patmat
Milestone
reproduction steps
using any version of Scala
problem
SeqExtractor is irrefutable, and the three cases together are exhaustive, but we fail to recognize that.
note
Matching on List can work around that by matching on Cons or Nil exhaustively with
List(1) match {
case Nil => 0 // or List() due to rewrite
case head :: Nil => 1
case head :: second :: tail => 2
}
Spun out of #12240
The text was updated successfully, but these errors were encountered: