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

'match may not be exhaustive' warning when matching on singleton types #5968

Closed
scabug opened this issue Jun 23, 2012 · 4 comments
Closed

'match may not be exhaustive' warning when matching on singleton types #5968

scabug opened this issue Jun 23, 2012 · 4 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jun 23, 2012

    object X
    def f(e: Either[Int, X.type]) = e match {
      case Left(i) => i
      case Right(X) => 0
    }

gives:

    warning: match may not be exhaustive.
    It would fail on the following input: Right(<not X>)

Is this correct? Surely the match is in fact exhaustive.

(c.f. http://stackoverflow.com/questions/11166098/why-does-scala-2-10-give-match-may-not-be-exhaustive-warning-when-matching-on, where it was suggested I post this as a bug report.)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 23, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5968?orig=1
Reporter: Scott Morrison (scott)
Affected Versions: 2.10.0-M4
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 23, 2012

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 24, 2012

@adriaanm said:
Awesome, thanks Jason! Could you please submit a pullreq?

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jun 25, 2012

@scabug scabug closed this Jun 25, 2012
@scabug scabug added the patmat label Apr 7, 2017
@scabug scabug added this to the 2.10.0-M4 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.