Skip to content

Commit 7cd8257

Browse files
committed
Add neg-test for method with @tailrec callsites that is not final.
1 parent d8bad7a commit 7cd8257

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/neg/tailcall/i1221b.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import annotation.tailrec
2+
3+
class Test {
4+
def foo(a: Int): Int = { // error: method is not final
5+
if ((foo(a - 1): @tailrec) > 0)
6+
foo(a - 1): @tailrec
7+
else
8+
foo(a - 2): @tailrec
9+
}
10+
}

0 commit comments

Comments
 (0)