Skip to content

Instantly share code, notes, and snippets.

@retronym
Created October 7, 2010 21:53
Show Gist options
  • Save retronym/615962 to your computer and use it in GitHub Desktop.
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...
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