【发布时间】:2017-10-17 22:21:31
【问题描述】:
trait A {
type T
def test(t: T): Unit
}
case class B[S <: A](a: S, t : S#T) {
def test() = a.test(t) // Error: type mismatch;
// found : B.this.t.type (with underlying type S#T)
// required: B.this.a.T
}
我期望上面的编译是错误的吗?我的代码可以修复吗?
【问题讨论】: