这不编译:
trait FileSystem { type P <: Path[this.type] } trait Path[S <: FileSystem] { self: fileSystem.P => val fileSystem: S }
自我类型约束如何依赖于该特征中的值成员?
解决方法
它不能(并且不确定它意味着什么).
trait FileSystem { type P <: Path[this.type] } trait Path[S <: FileSystem] { self: S#P => val fileSystem: S }