What is the difference between self-types and trait subclasses?

后端 未结 11 2099
名媛妹妹
名媛妹妹 2020-11-22 08:53

A self-type for a trait A:

trait B
trait A { this: B => }

says that \"A cannot be mixed into a concrete cl

11条回答
  •  情深已故
    2020-11-22 09:32

    in the first case, a sub-trait or sub-class of B can be mixed in to whatever uses A. So B can be an abstract trait.

提交回复
热议问题