Closed
Description
When compiling the following code:
trait C[T] { type U }
object C { type Aux[X, Y] = C[X] { type U = Y } }
def a: C[Int] { type U = Int } = ???
def b[T](c: C[T]): C[T] { type U = c.U } = ???
def test[T, U](c: C.Aux[T, U]) = ???
test(b(a))
Dotty produces the following compiler error:
[E007] Type Mismatch Error
test(b(a))
^^^^
found: C[Int]{U = Int}
required: C'.Aux[Int, U']
where: C is a trait
C' is a object
U is a type in trait C with bounds
U' is a type variable which is an alias of (param)1#U
There should be no type mismatch. Splitting the last expression like val x = b(a); test(x)
works.