Open
Description
Compiler version
3.6.2
Minimized code
object Test {
sealed trait Expr[T]
case class Person(name: String, age: Int)
object PP {
def unapply(e: Expr[Person]): String *: Int *: EmptyTuple = ???
}
val expr: Expr[Person] = ???
expr match {
case PP(str, _) => ???
}
}
Output
-- [E029] Pattern Match Exhaustivity Warning: scala3_bug.scala:10:2
10 | expr match {
| ^^^^
| match may not be exhaustive.
|
| It would fail on pattern case: PP()
|------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| There are several ways to make the match exhaustive:
| - Add missing cases as shown in the warning
| - If an extractor always return Some(...), write Some[X] for its return type
| - Add a case _ => ... at the end to match all remaining cases
------------------------------------------------------------------------------------------
1 warning found
Expectation
The code should compile without warnings.