aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/tailcall
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/tailcall')
-rw-r--r--tests/pos/tailcall/i1221.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pos/tailcall/i1221.scala b/tests/pos/tailcall/i1221.scala
new file mode 100644
index 000000000..80dcfdc4b
--- /dev/null
+++ b/tests/pos/tailcall/i1221.scala
@@ -0,0 +1,10 @@
+import annotation.tailrec
+
+object Test{
+ final def foo(a: Int): Int = {
+ if (foo(a - 1) > 0)
+ foo(a - 1): @tailrec
+ else
+ foo(a - 2): @tailrec
+ }
+}