Does a class with a self type of another class make sense?
问题 scala> class A defined class A scala> class B {this: A => } defined class B scala> new B <console>:10: error: class B cannot be instantiated because it does not conform to its self-type B with A new B ^ Class B sets the self type to class A , therefore class B (or a subclass of it) has to extend class A to create an instance of B . But is this possible at all, since a subclass of B can only extend one class (and this is class B ) ? So this leads me to the question, does it make sense to