Skip to content

No "unreachable code" warning when using partial function syntax #18493

Closed
@sake92

Description

@sake92

Compiler version

3.*

Minimized code

object PartialFunctionNoWarning {

  // nice warning
  "abc" match {
    case "abc" =>
    case "abc" =>
  }
  
  // no warnings
  val pf: PartialFunction[String, Unit] = {
    case "abc" =>
    case "abc" =>
  }

}

Output

"unreachable code" when using match.

Expectation

"unreachable code" shows when using partial function syntax too.
In scala 2 it does show a warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions