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/neg | |
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/neg')
-rw-r--r-- | tests/neg/i1240b.scala | 17 |
1 files changed, 17 insertions, 0 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("")) +} |