We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.2.0 / 3.2.1-RC2
val x = 42 val tup23 = (x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) tup23 match { // ^ warning: match may not be exhaustive (wrong) case (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => "Tuple Pattern" } // "Tuple Pattern"
https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/199
The warning recommends do add a case _: ..., where ... is what I pasted into the RHS of Tup23 below:
case _: ...
...
Tup23
val x = 42 val tup23 = (x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) type Tup23 = *:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,EmptyTuple]]]]]]]]]]]]]]]]]]]]]]] tup23 match { case (_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _) => "Tuple Pattern" // ^ warning: Unreachable case (wrong) case _: Tup23 => "Explicit type" } // "Tuple Pattern"
https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/200
The tupled pattern is both exhaustive and reachable, it should behave as the version with only 22 wildcards does: https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/195
The text was updated successfully, but these errors were encountered:
dwijnand
Successfully merging a pull request may close this issue.
Compiler version
3.2.0 / 3.2.1-RC2
Minimized code and Output
https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/199
The warning recommends do add a
case _: ...
, where...
is what I pasted into the RHS ofTup23
below:https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/200
Expectation
The tupled pattern is both exhaustive and reachable, it should behave as the version with only 22 wildcards does:
https://scastie.scala-lang.org/Sporarum/a3AOPPg2TmGhpjwxjxyrSA/195
The text was updated successfully, but these errors were encountered: