Skip to content

Unreachable case when matching with a match type subpattern #13189

Closed
@Katrix

Description

@Katrix

Compiler version

3.0.1
Did not happen on 3.0.0

Minimized code

trait MyTrait[A] {
  def pack[Z](u: Either[Int, A]): Int
}

def make[ElemTypes <: scala.NonEmptyTuple] = new MyTrait[scala.Tuple.Tail[ElemTypes]] {
  override def pack[Z](u: Either[Int, scala.Tuple.Tail[ElemTypes]]): Int = u match {
    case Left(hz) => ???
    case Right(tz) => ???
  }
}

Output

[error] 214 |      case Right(tz) => ???
[error]     |           ^^^^^^^^^
[error]     |           Unreachable case

Expectation

It compiles

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions