Skip to content

Unreachable code check in partial functions needs improvement #6902

Closed

Description

@scabug

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
}

Activity

  1. scabug commented on Jan 2, 2013

    @scabug
    Author

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

  2. scabug commented on Jan 19, 2013

    @scabug
    Author
  3. added this to the 2.10.1 milestone on Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions