blob: bef2ef276c70eb674644b86307033d0778640d39 (
plain) (
tree)
|
|
class A{
private def foo = 1
def callsFoo1(other: A & B): Int = other.foo
def callsFoo2(other: B & A): Int = other.foo
}
trait B {
def foo(i: Int) = i
}
object Test {
def main(args: Array[String]): Unit = {
val a = new A with B
a.callsFoo1(a)
a.callsFoo2(a)
}
}
|