diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-11-02 14:34:35 +0000 |
commit | b6778be91900b8161e705dc2598ef7af86842b0b (patch) | |
tree | d15e8ec18a37eec212f50f1ace27714d7e7d4d34 /test/files/neg/tailrec.scala | |
parent | ac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff) | |
download | scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2 scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip |
Begone t1737...
Diffstat (limited to 'test/files/neg/tailrec.scala')
-rw-r--r-- | test/files/neg/tailrec.scala | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/files/neg/tailrec.scala b/test/files/neg/tailrec.scala index e0ebde9863..5b9018ae89 100644 --- a/test/files/neg/tailrec.scala +++ b/test/files/neg/tailrec.scala @@ -9,21 +9,21 @@ object Winners { @tailrec def loopsucc1(x: Int): Int = loopsucc1(x - 1) @tailrec def loopsucc2[T](x: Int): Int = loopsucc2[T](x - 1) - + def ding() { object dong { @tailrec def loopsucc3(x: Int): Int = loopsucc3(x) } () } - + def inner(q: Int) = { @tailrec def loopsucc4(x: Int): Int = loopsucc4(x + 1) - + loopsucc4(q) } - + object innerBob { @tailrec def loopsucc5(x: Int): Int = loopsucc5(x) } @@ -45,19 +45,19 @@ object Failures { else n * facfail(n - 1) } -class Failures { +class Failures { // not private, not final @tailrec def fail1(x: Int): Int = fail1(x) - + // a typical between-chair-and-keyboard error @tailrec final def fail2[T](xs: List[T]): List[T] = xs match { case Nil => Nil case x :: xs => x :: fail2[T](xs) } - + // unsafe @tailrec final def fail3[T](x: Int): Int = fail3(x - 1) - + // unsafe class Tom[T](x: Int) { @tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1) |