From ca47bea3eed87eaa6005161c831805cd68fd6e59 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Mon, 18 Apr 2016 22:12:06 +0200 Subject: Test #1221. --- tests/neg/tailcall/i1221.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/neg/tailcall/i1221.scala (limited to 'tests/neg') diff --git a/tests/neg/tailcall/i1221.scala b/tests/neg/tailcall/i1221.scala new file mode 100644 index 000000000..5c3286e97 --- /dev/null +++ b/tests/neg/tailcall/i1221.scala @@ -0,0 +1,10 @@ +import annotation.tailrec + +object Test{ + final def foo(a: Int): Int = { + if ((foo(a - 1): @tailrec) > 0) // error: not in tail position + foo(a - 1): @tailrec + else + foo(a - 2): @tailrec + } +} -- cgit v1.2.3