aboutsummaryrefslogtreecommitdiff
path: root/tests/run/PrivateAnd.scala
blob: bef2ef276c70eb674644b86307033d0778640d39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)	
  }
}