Skip to content

Match exhaustion warning on literal type #11603

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

Closed
dwijnand opened this issue Jul 2, 2019 · 0 comments · Fixed by scala/scala#9209
Closed

Match exhaustion warning on literal type #11603

dwijnand opened this issue Jul 2, 2019 · 0 comments · Fixed by scala/scala#9209

Comments

@dwijnand
Copy link
Member

dwijnand commented Jul 2, 2019

class C {
  def m(x: true) = x match {
    case true => println("the one true path")
  }
}
14:53:27 $ scala exhaustive-literals.scala
exhaustive-literals.scala:2: warning: match may not be exhaustive.
It would fail on the following input: false
  def m(x: true) = x match {
                   ^

Scala 2.13.0

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

Successfully merging a pull request may close this issue.

2 participants