diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-04 10:51:56 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-04 10:54:39 +0200 |
commit | 14d506a86f5920ac50777f1bbb7aade0557d6122 (patch) | |
tree | 3066f39830b0afa84086efdc98d0c523b5452a46 /tests/pos | |
parent | 99b9dbd3246fb2906dc082f6c6175a406259fae7 (diff) | |
download | dotty-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')
-rw-r--r-- | tests/pos/i503.scala | 6 | ||||
-rw-r--r-- | tests/pos/superacc.scala | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/tests/pos/i503.scala b/tests/pos/i503.scala index 93f275c4d..fd25dc979 100644 --- a/tests/pos/i503.scala +++ b/tests/pos/i503.scala @@ -3,7 +3,11 @@ class HelloWorld { object TypeBool; class Fct { - def g(x : Int) = TypeBool // breaks. + def g(x : Int) = TypeBool + } + + trait Fct2 { + def g(x : Int) = TypeBool } } } 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 + } +} |