Skip to content

named tuple patterns break exhaustivity checks #22245

Closed
@bishabosha

Description

@bishabosha

Compiler version

3.6.2

Minimized code

//> using options -language:experimental.namedTuples

def find(explore: List[(seen: Set[Int], x: Int, y: Int)]): Any =
  explore match
    case Nil => ???
    case (seen = s, x = x, y = y) :: rest => ???

Output

-- [E029] Pattern Match Exhaustivity Warning: ----------------------------------
2 |  explore match
  |  ^^^^^^^
  |  match may not be exhaustive.
  |
  |  It would fail on pattern case: List(_, _*)
  |
  | longer explanation available when compiling with `-explain`

Expectation

the named tuple pattern will always match, so no warning

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions