From 7cd8257730563d4b8671b2d342d35a5952119205 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Mon, 18 Apr 2016 22:19:38 +0200 Subject: Add neg-test for method with @tailrec callsites that is not final. --- tests/neg/tailcall/i1221b.scala | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/neg/tailcall/i1221b.scala (limited to 'tests/neg/tailcall') diff --git a/tests/neg/tailcall/i1221b.scala b/tests/neg/tailcall/i1221b.scala new file mode 100644 index 000000000..f8e2add9a --- /dev/null +++ b/tests/neg/tailcall/i1221b.scala @@ -0,0 +1,10 @@ +import annotation.tailrec + +class Test { + def foo(a: Int): Int = { // error: method is not final + if ((foo(a - 1): @tailrec) > 0) + foo(a - 1): @tailrec + else + foo(a - 2): @tailrec + } +} -- cgit v1.2.3