This is as far as I could minimize it. All remaining parts appear to be necessary:
object Test {
class A[+V]
case class B[V](value: C[V]) extends A[V]
class C[A](val value: A)
def f[V](a: A[V]): Unit =
a match {
case B(c: C[V]) => c.value match { case _: String => }
}
}
The compiler hangs in typer. Reproduced with 2.12.20, 2.12.21, 2.13.16, 2.13.18. I remember seeing a bug involving a nested pattern match that required types with certain variance before, but I can't remember the details and I didn't find it in the bug tracker.
It compiles in 3.7.4.
This is as far as I could minimize it. All remaining parts appear to be necessary:
The compiler hangs in typer. Reproduced with 2.12.20, 2.12.21, 2.13.16, 2.13.18. I remember seeing a bug involving a nested pattern match that required types with certain variance before, but I can't remember the details and I didn't find it in the bug tracker.
It compiles in 3.7.4.