Created
October 7, 2010 21:53
-
-
Save retronym/615962 to your computer and use it in GitHub Desktop.
I couldn't remember if stackable traits intercept calls internally in the super class. They do...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> trait A { def foo = 1; def bar = foo } | |
defined trait A | |
scala> trait B extends A { abstract override def foo = super.foo + 1 } | |
defined trait B | |
scala> new A with B {} | |
res2: java.lang.Object with A with B = $anon$1@540fe861 | |
scala> .bar | |
res3: Int = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment