Skip to content

Commit ffb6d24

Browse files
committed
Test that private member selection on AndTypes works.
1 parent 813b5f3 commit ffb6d24

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/run/PrivateAnd.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class A{
2+
private def foo = 1
3+
def callsFoo1(other: A & B): Int = other.foo
4+
def callsFoo2(other: B & A): Int = other.foo
5+
}
6+
7+
trait B {
8+
def foo(i: Int) = i
9+
}
10+
11+
object Test {
12+
def main(args: Array[String]): Unit = {
13+
val a = new A with B
14+
a.callsFoo1(a)
15+
a.callsFoo2(a)
16+
}
17+
}

0 commit comments

Comments
 (0)