Skip to content

Commit 1aa1d75

Browse files
committed
Add a test that tests supercalls in traits.
1 parent b2634a8 commit 1aa1d75

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/run/supercalls-traits.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
trait A {
2+
def foo = 1
3+
}
4+
5+
trait B {
6+
def foo = 2
7+
}
8+
9+
class C extends A with B {
10+
override def foo = super[A].foo + super[B].foo
11+
}
12+
13+
object Test {
14+
def main(args: Array[String]) = assert(new C().foo == 3)
15+
}

0 commit comments

Comments
 (0)