Closed
Description
Compiler version
3.4.1
Minimized code
sealed trait T_A
sealed trait T_B[A, B]
case class CC_A[A, C, D](a: T_B[C, D]) extends T_B[A, T_B[C, D]]
case class CC_B() extends T_A
case class CC_C[A, B]() extends T_A
case class CC_D[C, D](b: T_B[C, D], c: T_A)
extends T_B[CC_A[Int, Byte, Int], T_B[C, D]]
val v_a: T_B[CC_A[Int, Byte, Int], T_B[Char, Char]] = CC_D(null, CC_B())
val v_b: Int = v_a match {
case CC_A(_) => 0
case CC_D(_, CC_C()) => 1
}
Output
Crashes error at runtime
Expectation
Should give a warning at compile time that the pattern match is not exhaustive.