Skip to content

Wrong exhaustivity warning for XXL tuples #14588

Closed
@pweisenburger

Description

@pweisenburger

Compiler version

3.1.1

Minimized code

(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) match
  case (x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23) =>

Output

-- [E029] Pattern Match Exhaustivity Warning:
12 |    (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23) match
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |match may not be exhaustive.
   |
   |It would fail on pattern case: _: *:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,*:[Int,EmptyTuple]]]]]]]]]]]]]]]]]]]]]]]

Expectation

I think the compiler is wrong. The match would not fail on this pattern.

There is no warning for non-XXL tuples.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions