aboutsummaryrefslogtreecommitdiff
path: root/tests/run/supercalls-traits.scala
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-27 15:20:17 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-27 19:17:10 +0200
commitabe2a47dc08ad888caf2c7c2c365d63b328d01b3 (patch)
tree4e9c5cc771893e1f97af281768b09ef91e041d80 /tests/run/supercalls-traits.scala
parent6ec4b0a7753ffadaf85e4ffee0ad8bd1749cde01 (diff)
downloaddotty-abe2a47dc08ad888caf2c7c2c365d63b328d01b3.tar.gz
dotty-abe2a47dc08ad888caf2c7c2c365d63b328d01b3.tar.bz2
dotty-abe2a47dc08ad888caf2c7c2c365d63b328d01b3.zip
Add a test that tests supercalls in traits.
Diffstat (limited to 'tests/run/supercalls-traits.scala')
-rw-r--r--tests/run/supercalls-traits.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run/supercalls-traits.scala b/tests/run/supercalls-traits.scala
new file mode 100644
index 000000000..09e841f46
--- /dev/null
+++ b/tests/run/supercalls-traits.scala
@@ -0,0 +1,15 @@
+trait A {
+ def foo = 1
+}
+
+trait B {
+ def foo = 2
+}
+
+class C extends A with B {
+ override def foo = super[A].foo + super[B].foo
+}
+
+object Test {
+ def main(args: Array[String]) = assert(new C().foo == 3)
+}