diff options
author | Martin Odersky <odersky@gmail.com> | 2016-05-03 11:00:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-05-18 19:43:22 +0200 |
commit | 3a97b3fb546bc57afb8cbfadb27eb9e66b0842d1 (patch) | |
tree | 74d8b0051fc434f37de63793bf4fba4e0267df06 /tests | |
parent | 9aa800f8a9905de059b6e34554cb166a9776dff3 (diff) | |
download | dotty-3a97b3fb546bc57afb8cbfadb27eb9e66b0842d1.tar.gz dotty-3a97b3fb546bc57afb8cbfadb27eb9e66b0842d1.tar.bz2 dotty-3a97b3fb546bc57afb8cbfadb27eb9e66b0842d1.zip |
Another test case involving super accessors
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/i1240b.scala | 17 | ||||
-rw-r--r-- | tests/run/i1240.scala | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/tests/neg/i1240b.scala b/tests/neg/i1240b.scala new file mode 100644 index 000000000..6987dbc96 --- /dev/null +++ b/tests/neg/i1240b.scala @@ -0,0 +1,17 @@ +// yet another variant, testing super accessors + +trait T { + def foo[B](x: C[B]): C[B] +} +abstract class A extends T { + type C[X] + def foo[B](x: C[B]): C[B] = {println("A.C"); x} + def foo[B](x: List[B]): List[B] = {println("A.List"); x} +} +trait U extends T { + def foo[B](x: C[B]): C[B] = super.foo[B](x) +} +object Test extends A with U { + type C[X] = List[X] + def main(args: Array[String]) = foo(List("")) +} diff --git a/tests/run/i1240.scala b/tests/run/i1240.scala index 860806ba5..7092d9131 100644 --- a/tests/run/i1240.scala +++ b/tests/run/i1240.scala @@ -1,6 +1,6 @@ // A tricky case of overriding behavior -// Note: It would be acceptable if this produced an error instead. -// Bit testing this is tricky. +// Note: It might be acceptable if this produced an error instead. +// But testing this is tricky. abstract class Base[T] { def foo(x: T): String } |