Skip to content

Unreachable code check in partial functions needs improvement #6902

@scabug

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
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions