aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-23 13:10:28 +0100
committerMartin Odersky <odersky@gmail.com>2017-02-23 13:10:28 +0100
commitc6a09827b2c871cf85bbd0b87c55acb8344d3b97 (patch)
treeac1b941eb647cfea4f57224d5320970187cd7e29 /tests/neg
parenta0f47a00131935d85f957a80d0c4472eaa7b5baa (diff)
downloaddotty-c6a09827b2c871cf85bbd0b87c55acb8344d3b97.tar.gz
dotty-c6a09827b2c871cf85bbd0b87c55acb8344d3b97.tar.bz2
dotty-c6a09827b2c871cf85bbd0b87c55acb8344d3b97.zip
Better error messages for missing type of recursive definitions
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i2001.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/neg/i2001.scala b/tests/neg/i2001.scala
new file mode 100644
index 000000000..82518890c
--- /dev/null
+++ b/tests/neg/i2001.scala
@@ -0,0 +1,6 @@
+class A {
+ def odd(x: Int) = if (x == 0) false else !even(x-1)
+ def even(x: Int) = if (x == 0) true else !odd(x-1) // error: overloaded or recursive method needs result type
+
+ lazy val x = x // error: recursive value needs type
+}