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

Unreachable code check in partial functions needs improvement #6902

Closed
scabug opened this issue Jan 2, 2013 · 2 comments
Closed

Unreachable code check in partial functions needs improvement #6902

scabug opened this issue Jan 2, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jan 2, 2013

Partial functions don't appear to be checked for unreachable code to the same extent as match expressions (the trivial case with a variable pattern is checked properly):

Some(1) match { 
  case Some(a) => 2
  case Some(b) => 3 // warning: "unreachable code"
}

Some(Some(1)) collect { 
  case Some(a) => 2
  case Some(b) => 3 // no warning
}
@scabug
Copy link
Author

@scabug scabug commented Jan 2, 2013

Imported From: https://issues.scala-lang.org/browse/SI-6902?orig=1
Reporter: Rob Norris (rnorris)
Affected Versions: 2.10.0-RC5

Loading

@scabug
Copy link
Author

@scabug scabug commented Jan 19, 2013

Loading

@scabug scabug closed this Jan 25, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants