aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/tailcall/tailrec.scala
diff options
context:
space:
mode:
authorvsalvis <salvisbergvera@gmail.com>2015-07-10 17:01:35 +0200
committerVladimirNik <vladimir.nikolaev9@gmail.com>2016-02-18 17:54:45 +0100
commit1ed38673d4c88d573363459d316fdfe275d05025 (patch)
tree6ae87391dab765853b97c81dfa4f05bbba2e527b /tests/neg/tailcall/tailrec.scala
parent4be70a5a8469c1355c84bef70936a81f899a9678 (diff)
downloaddotty-1ed38673d4c88d573363459d316fdfe275d05025.tar.gz
dotty-1ed38673d4c88d573363459d316fdfe275d05025.tar.bz2
dotty-1ed38673d4c88d573363459d316fdfe275d05025.zip
Negtests with // error comments
Diffstat (limited to 'tests/neg/tailcall/tailrec.scala')
-rw-r--r--tests/neg/tailcall/tailrec.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/neg/tailcall/tailrec.scala b/tests/neg/tailcall/tailrec.scala
index 83a0c1a9e..49d71ce13 100644
--- a/tests/neg/tailcall/tailrec.scala
+++ b/tests/neg/tailcall/tailrec.scala
@@ -40,19 +40,19 @@ class Winners {
object Failures {
@tailrec
- def facfail(n: Int): Int =
+ def facfail(n: Int): Int = // error
if (n == 0) 1
- else n * facfail(n - 1)
+ else n * facfail(n - 1) // error
}
class Failures {
// not private, not final
- @tailrec def fail1(x: Int): Int = fail1(x)
+ @tailrec def fail1(x: Int): Int = fail1(x) // error
// a typical between-chair-and-keyboard error
- @tailrec final def fail2[T](xs: List[T]): List[T] = xs match {
+ @tailrec final def fail2[T](xs: List[T]): List[T] = xs match { // error
case Nil => Nil
- case x :: xs => x :: fail2[T](xs)
+ case x :: xs => x :: fail2[T](xs) // error
}
// unsafe
@@ -60,6 +60,6 @@ class Failures {
// unsafe
class Tom[T](x: Int) {
- @tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1)
+ @tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1) // error // error
}
}