Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** I want to make use of inherited function print() in inner class */
- class PassImplToInnerClass extends OutputterImpl {
- class Inner extends Outputter {
- // ??? is there a less tedious way to avoid this ERROR:
- // class Inner needs to be abstract, since method print in trait Outputter of type ()Unit is not defined
- def print() = PassImplToInnerClass.this.print
- }
- }
- trait Outputter { def print() }
- class OutputterImpl extends Outputter {
- def print() = println("bla")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement