Open
Description
Compiler version
3.6.3, Scala 3.7.0-RC1-bin-20250222-4dc4668-NIGHTLY
Minimized code
package bug
object ExhibitA:
trait Foo:
type A
type B
type F[X, Y] = Foo { type A = X; type B = Y }
// fails
type M[T] = T match
case F[a, b] => (a, b)
trait Bar extends Foo { type A = Int; type B = String }
summon[M[Bar] =:= (Int, String)]
object ExhibitB:
trait Foo:
type A
type F[X] = Foo { type A = X }
// works
type M[T] = T match
case F[a] => a
trait Bar extends Foo { type A = Int }
summon[M[Bar] =:= Int]
Output
[error] .\bug.scala:14:15
[error] The match type contains an illegal case:
[error] case bug.ExhibitA.F[a, b] => (a, b)
[error] The pattern contains a type alias `F`.
[error] (this error can be ignored for now with `-source:3.3`)
Expectation
Successful compilation