Open
Description
Here is a minimal test case that shows the problem:
trait Main {
trait A {
type B
}
trait C {
def c(a: A, x: Int = 0)(b: a.B)
}
def c: C
def ok(a: A)(b: a.B) = c.c(a, 42)(b)
def fail(a: A)(b: a.B) = c.c(a)(b)
}
If I remove the x
parameter default value, or explicitly fill its value, it works fine.
But compiling the above code produces the following error:
[error] /Volumes/Home/workspace/scala-dependent-types/src/main/scala/Main.scala:15: type mismatch;
[error] found : b.type (with underlying type a.B)
[error] required: x$1.B
[error] def fail(a: A)(b: a.B) = c.c(a)(b)