Skip to content

Wrong exhaustive check with sequence wildcard on case class with custom unapply #23459

@SrTobi

Description

@SrTobi

Compiler version

3.7.1

Minimized code

case class Test() object Test { def unapply(int: Test): Some[Seq[Int]] = Some(Seq(1, 2)) } @main def run = { Test() match { case Test(x*) => println(x) } }

Output

Compiles, runs and prints List(1, 2), but has the following warning:

match may not be exhaustive. It would fail on pattern case: Test(_) Test() match { 

Expectation

The compiler should not emit any error because of the exhaustive check.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions