diff options
author | Paul Phillips <paulp@improving.org> | 2010-04-15 22:18:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-04-15 22:18:15 +0000 |
commit | 11398dd393fe3eff544bfbafafb584d3acd66e05 (patch) | |
tree | bdbcc39f71339813abb55689eeb99ef9c417d2c7 /test/files/neg/tailrec.check | |
parent | 41860ffcf7b29f8857b21ec5559f0a9ef9d0e96f (diff) | |
download | scala-11398dd393fe3eff544bfbafafb584d3acd66e05.tar.gz scala-11398dd393fe3eff544bfbafafb584d3acd66e05.tar.bz2 scala-11398dd393fe3eff544bfbafafb584d3acd66e05.zip |
Improved @tailrec error messages to specify the...
Improved @tailrec error messages to specify the reason. In the process
fixed old bug involving tail call transformation. Closes #3275, #2018.
Review by dragos.
Diffstat (limited to 'test/files/neg/tailrec.check')
-rw-r--r-- | test/files/neg/tailrec.check | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/files/neg/tailrec.check b/test/files/neg/tailrec.check index 22d70e82a0..27d99f632e 100644 --- a/test/files/neg/tailrec.check +++ b/test/files/neg/tailrec.check @@ -1,10 +1,16 @@ -tailrec.scala:6: error: could not optimize @tailrec annotated method +tailrec.scala:43: error: could not optimize @tailrec annotated method: it contains a recursive call not in tail position def facfail(n: Int): Int = ^ -tailrec.scala:42: error: could not optimize @tailrec annotated method +tailrec.scala:50: error: could not optimize @tailrec annotated method: it is neither private nor final so can be overridden @tailrec def fail1(x: Int): Int = fail1(x) ^ -tailrec.scala:45: error: could not optimize @tailrec annotated method - @tailrec def fail2[T](xs: List[T]): List[T] = xs match { - ^ -three errors found +tailrec.scala:53: error: could not optimize @tailrec annotated method: it contains a recursive call not in tail position + @tailrec final def fail2[T](xs: List[T]): List[T] = xs match { + ^ +tailrec.scala:59: error: could not optimize @tailrec annotated method: it is called recursively with different type arguments + @tailrec final def fail3[T](x: Int): Int = fail3(x - 1) + ^ +tailrec.scala:63: error: could not optimize @tailrec annotated method: it changes type of 'this' on a polymorphic recursive call + @tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1) + ^ +5 errors found |