aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/superacc.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-05-04 10:51:56 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-04 10:54:39 +0200
commit14d506a86f5920ac50777f1bbb7aade0557d6122 (patch)
tree3066f39830b0afa84086efdc98d0c523b5452a46 /tests/pos/superacc.scala
parent99b9dbd3246fb2906dc082f6c6175a406259fae7 (diff)
downloaddotty-14d506a86f5920ac50777f1bbb7aade0557d6122.tar.gz
dotty-14d506a86f5920ac50777f1bbb7aade0557d6122.tar.bz2
dotty-14d506a86f5920ac50777f1bbb7aade0557d6122.zip
New tests
Added test for previous PR on super accessors. Updated test for #503 to check both inner classes and inner traits.
Diffstat (limited to 'tests/pos/superacc.scala')
-rw-r--r--tests/pos/superacc.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/pos/superacc.scala b/tests/pos/superacc.scala
new file mode 100644
index 000000000..91397003d
--- /dev/null
+++ b/tests/pos/superacc.scala
@@ -0,0 +1,17 @@
+// scenario one: supercalls in traits
+abstract class C {
+ def foo: Int = 2
+ def baz: Int = 2
+}
+
+trait T extends C {
+ override def foo = super.foo + 1
+}
+
+
+// scenario 2: supercalls in nested classes
+class D extends C with T {
+ class I {
+ val x= D.super.baz
+ }
+}