1 2 3 4 5 6 7 8 9 10 11 12 13 14
abstract class A { def foo: Int } trait B { def foo = 2 } object Test extends A with B { def main(args: Array[String]): Unit = { this.foo } }