Skip to content

nested named irrefutable typetest pattern causes exhaustivity warning #10994

@bishabosha

Description

@bishabosha

Minimized code

def foo = true match
  case (b: Boolean): Boolean => ()

Output

-- [E029] Pattern Match Exhaustivity Warning: sandbox/match/example.scala:1:10 -
1 |def foo = true match
  |          ^^^^
  |          match may not be exhaustive.
  |
  |          It would fail on pattern case: true, false

Expectation

no warning.

the wildcard case produces no warning:

def foo = true match
  case (_: Boolean): Boolean => ()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions