This example from tests/pos/t1569a.scala works:
object Bug2 {
class C { type T }
class D extends C { type T = String }
def foo(x: Int)(y: C)(z: y.T): Unit = {}
foo(3)(new D)("hello")
}
But replacing new D by new D {} fails with:
tests/pos/t1569a.scala:11: error: type mismatch:
found : String("hello")
required: Bug2.C#T
foo(3)(new D { })("hello")
^
one error found
Whether the expected type of the parameter is used or not is determined by Typer#ensureNoLocalRefs