Open
Description
Compiler version
3.5.0-RC1
Minimized code
type At[V, L <: TList[R[V]], K <: Long] <: Option[?] = L match
case Empty.type => None.type // When this line is commented out, the code does not compile
case Cons[R[V], (k, v), tail] => None.type
trait TList[+T]
object Empty extends TList[Nothing]
class Cons[+E, +H <: E, +T <: TList[E]] extends TList[E]
type R[+T] = (Long, T)
Output
Compiles fine
Expectation
Compiler error, similarly to what happens for
type At[V, L <: TList[R[V]], K <: Long] <: Option[?] = L match
// case Empty.type => None.type
case Cons[R[V], (k, v), tail] => None.type
trait TList[+T]
object Empty extends TList[Nothing]
class Cons[+E, +H <: E, +T <: TList[E]] extends TList[E]
type R[+T] = (Long, T)
Error message:
The match type contains an illegal case