diff options
author | Martin Odersky <odersky@gmail.com> | 2013-12-09 11:15:25 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-12-09 11:15:25 +0100 |
commit | a53101c6fc3f06fed881e22736d134f6e7893ae0 (patch) | |
tree | e8d6878d9642a42c5e92e8546e4403aedcb12f3e /tests | |
parent | 34993a55387b381dc9e2e754d7179f0385974abd (diff) | |
download | dotty-a53101c6fc3f06fed881e22736d134f6e7893ae0.tar.gz dotty-a53101c6fc3f06fed881e22736d134f6e7893ae0.tar.bz2 dotty-a53101c6fc3f06fed881e22736d134f6e7893ae0.zip |
Fixes to inherited result types in Namer.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/inferred.scala | 5 | ||||
-rw-r--r-- | tests/pos/sigs.scala | 21 |
2 files changed, 23 insertions, 3 deletions
diff --git a/tests/pos/inferred.scala b/tests/pos/inferred.scala index 441ae9650..525848541 100644 --- a/tests/pos/inferred.scala +++ b/tests/pos/inferred.scala @@ -16,13 +16,12 @@ object NIL extends LIST[Nothing] { def tail = ??? } -class CONS[T](hd: T, tl: LIST[T]) extends LIST[T] { +class CONS[U](hd: U, tl: LIST[U]) extends LIST[U] { def isEmpty = false - def head = hd + def head: U = hd def tail = tl } - object Inferred { def foo[T](x: T): T = x diff --git a/tests/pos/sigs.scala b/tests/pos/sigs.scala new file mode 100644 index 000000000..4b91015ee --- /dev/null +++ b/tests/pos/sigs.scala @@ -0,0 +1,21 @@ +object sigs { + + var x = 7 * 9 + + class Base { + + def foo(x: Int): Any = 33 + + def foo: Object = "x" + + } + + class Sub extends Base { + + override def foo = "abc" + + override def foo(x: Int) = "abc" + } + + +}
\ No newline at end of file |