在各种Scala文献中,我看到一些使用"this"的自我类型注释和其他使用"self"的注释:
trait A { this: B => ... }
trait A { self: B => ... }
Run Code Online (Sandbox Code Playgroud)
使用"this"或"self"之间有什么真正的区别吗?你用的是什么名字是否重要?这有效吗?
trait A { foo: B => ... }
Run Code Online (Sandbox Code Playgroud) 问题的作者
用抽象类型交换类型参数=>在他的类定义的开头写了一个.例:
abstract class Thing { t =>
type A
type G <: Group { type A = t.A }
val group: G
}
Run Code Online (Sandbox Code Playgroud)
什么t =>意思?
因为在Google&Co中很难找到,有人可以给我更多背景信息或提供链接,我可以在哪里找到有关这种语言结构的更多信息?