Scala Programming Language
  1. Scala Programming Language
  2. SI-6902

Unreachable code check in partial functions needs improvement

    Details

      Description

      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
      }
      

        Issue Links

          Activity

          Show
          Jason Zaugg added a comment - https://github.com/scala/scala/pull/1928

            People

            • Assignee:
              Jason Zaugg
              Reporter:
              Rob Norris
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development