Skip to content

Patternmatch Unreachable Warning #20121

Closed
@CyrilFMoser

Description

@CyrilFMoser

Compiler version

3.4.1

Minimized code

sealed trait T_A[A, B]
type X = T_A[
  Byte,
  Byte
]
case class CC_B[A](
    a: A
) extends T_A[A, X]
val v_a: T_A[X, X] = CC_B(null)

val v_b = v_a match {
  case CC_B(_) => 0
  case _       => 1
}

Output

The value of v_b is 0

Expectation

The compiler gives an unreachable warning for case CC_B(_), so it should not be able to reach that case.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions