Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Forked from anonymous/gist:711741
Created November 23, 2010 13:31
Show Gist options
  • Save pedrofurla/711758 to your computer and use it in GitHub Desktop.
Save pedrofurla/711758 to your computer and use it in GitHub Desktop.
trait Bar { def bar(msg:String):Unit }
trait Qux extends Bar {
abstract override def bar(msg:String="Qux Says Hello") = {
super.bar(msg)
println("qux: " + msg)
}
}
class Foo extends Bar {
def bar(msg:String="Foo Says Hello") = println(msg)
}
val f = new Foo() with Qux
f.bar()
@pedrofurla
Copy link
Author

trait Bar { def bar(msg:String):Unit }

trait Qux extends Bar {
abstract override def bar(msg:String="Qux Says Hello") = {
super.bar(msg)
println("qux: " + msg)
}
}

class Foo extends Bar {
def bar(msg:String="Foo Says Hello") = println(msg)
}

val f = new Foo() with Qux
f.bar()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment