scala - Override a function inside an Object inside of a Trait -
say have this:
trait { object b { def dosomething = "test" } } class c extends { def out = print(b.dosomething) } class d extends { // override b.dosomething }
how override function dosomething
inside of object b
?
this kind of duplicate, of 2 separate issues:
first, objects not meant overridden. second, inheriting nested class straightforward
class a{ class b{ def foo = 1 } } class c extends a{ class b extends super.b{ override def foo = 2 } }
Comments
Post a Comment