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
objectTest {
deffoo(a: Boolean, b: Boolean):Unit=
(a, b) match {
case (false, _) =>case (true, _) =>case (_, false) =>// unreachable
}
}
Output
No warning
Expectation
Emit an unreachable case warning like Scala 2 does:
warning: unreachable code
case (_, false) =>// unreachable^
However, note that Scala 2 also fails to emit such a warning in a more complex example:
objectTest {
deffoo(a: Option[Boolean], b: Boolean):Unit=
(a, b) match {
case (Some(false), _) =>case (Some(true), _) =>case (None, _) =>case (_, false) =>// unreachable
}
}
In Scala 3 the issue seems to be that tuples are not considered to be decomposable types, but I don't know if this is intentional to avoid a complexity blow up /cc @liufengyun
The text was updated successfully, but these errors were encountered:
Compiler version
Scala pre-3.0.1 at commit c1eaf8c
Minimized code
Output
No warning
Expectation
Emit an unreachable case warning like Scala 2 does:
However, note that Scala 2 also fails to emit such a warning in a more complex example:
In Scala 3 the issue seems to be that tuples are not considered to be decomposable types, but I don't know if this is intentional to avoid a complexity blow up /cc @liufengyun
The text was updated successfully, but these errors were encountered: