You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- [E029] PatternMatchExhaustivityWarning: scala3_bug.scala:10:210| 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 matchexhaustive:
|-Add missing cases as shown in the warning
|-If an extractor always returnSome(...), write Some[X] for its returntype|-Add a case _ => ... at the end to match all remaining cases
------------------------------------------------------------------------------------------1 warning found
Expectation
The code should compile without warnings.
The text was updated successfully, but these errors were encountered:
the warnings goes away. Also if the code is changed to do a match on Person instead of Expr[Person] like
object Test {
case class Person(name: String, age: Int)
object PP {
def unapply(e: Person): String *: Int *: EmptyTuple = ???
}
val expr: Person = ???
expr match {
case PP(str, _) => ???
}
}
then there is also no warning.
eejbyfeldt
changed the title
False exhaustivity warning when returning tuple using *:
False exhaustivity warning when unapply return type is a tuple defined using *:
Jan 13, 2025
Compiler version
3.6.2
Minimized code
Output
Expectation
The code should compile without warnings.
The text was updated successfully, but these errors were encountered: