Questions tagged «self-type»

11
自我类型和特征子类之间有什么区别?
特质的自我类型A: trait B trait A { this: B => } 他说:“ A不能混入既不扩展又不扩展的具体阶级B”。 另一方面,以下内容: trait B trait A extends B 表示“任何(具体的或抽象的)类混合A也将在B中混合”。 这两句话不是同一回事吗?自类型似乎仅用于创建简单的编译时错误。 我想念什么?
387 scala  traits  self-type 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.