Skip to content

Instantly share code, notes, and snippets.

@songfei1983
Created April 28, 2016 08:44
Show Gist options
  • Save songfei1983/9b3de56ad41ec1db24362d6afd971053 to your computer and use it in GitHub Desktop.
Save songfei1983/9b3de56ad41ec1db24362d6afd971053 to your computer and use it in GitHub Desktop.
trait A {
def foo = println("I am A." + super.toString)
}
trait B extends A {
override def foo = {
println("I am B." + super.toString)
super.foo
}
}
trait C extends A {
override def foo = {
println("I am C." + super.toString)
super.foo
}
}
object D extends A with B with C {
def fooo = {
println("I am D." + super.toString)
foo
}
}
D.fooo
// I am D.$line43.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$D$@4aa7bb1b
// I am C.$line43.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$D$@4aa7bb1b
// I am B.$line43.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$D$@4aa7bb1b
// I am A.$line43.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$D$@4aa7bb1b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment