Closed
Description
Match type with no cases reduces to unreported ErrorType
Compiler version
3.4.2-RC1
Minimized code
trait T[N]:
type M = N match
case 0 => Any // or anything else
val t: T[Double] = new T[Double] {}
val x: t.M = "hello"
val y: Boolean = x // compiles + ClassCastException
We also have the same issue when using a projection:
val z: T[Double]#M = "hello"
val _: Boolean = z // compiles + ClassCastException
Minimised from @Gedochao's #19936 (comment)