Skip to content

Commit 979aad0

Browse files
committed
Rename successful tailrec tests from fail* to succ*
Add one more tailrec test with polymorphic `this`
1 parent f693e04 commit 979aad0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/neg-tailcall/tailrec.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ class Winners {
3737
case x :: xs => succ3(xs, x :: acc)
3838
}
3939

40-
@tailrec final def fail3[T](x: Int): Int = fail3(x - 1)
40+
@tailrec final def succ4[T](x: Int): Int = succ4(x - 1)
4141

42-
class Tom[T](x: Int) {
43-
@tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1)
42+
class Tom[T] {
43+
@tailrec final def succ5[U](other: Tom[U], x: Int): Int = other.succ5[U](other, x - 1)
44+
@tailrec final def succ6(x: Int): Int = (new Tom[Int]).succ6(x - 1)
4445
}
4546
}
4647

0 commit comments

Comments
 (0)