Skip to content
New issue

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

Missing unreachable case warning #18118

Closed
Sporarum opened this issue Jul 3, 2023 · 2 comments · Fixed by #18326
Closed

Missing unreachable case warning #18118

Sporarum opened this issue Jul 3, 2023 · 2 comments · Fixed by #18326
Assignees
Labels

Comments

@Sporarum
Copy link
Contributor

Sporarum commented Jul 3, 2023

Compiler version

3.3.0 / 3.3.1-RC1

Minimized code

object O2:
  sealed trait A
  case class B() extends A
  
  
  def bigMatch(x: A) = x match
  	case B() =>
  	case _ => // no warning

Expectation

The line case _ => should have the same warning as other configurations:
Unreachable case except for null (if this is intentional, consider writing case null => instead).

The above as well as working examples can be found at:
https://scastie.scala-lang.org/ZS2DRtbBQSODAVpTotH45w

@Sporarum Sporarum added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 3, 2023
@dwijnand dwijnand added area:pattern-matching stat:needs triage Every issue needs to have an "area" and "itype" label and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 3, 2023
@dwijnand dwijnand self-assigned this Jul 3, 2023
@dwijnand dwijnand removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Jul 3, 2023
@som-snytt
Copy link
Contributor

Reminiscent of a recent Scala 2 ticket where the number of cases made a difference in messaging.

@dwijnand dwijnand added the Spree Suitable for a future Spree label Jul 19, 2023
@scala-center-bot
Copy link

This issue was picked for the Issue Spree No. 34 of 01 August 2023 which takes place in 7 days. @dwijnand, @XLPI, antognini will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants