aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/typers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/typers.scala')
-rw-r--r--tests/pos/typers.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/pos/typers.scala b/tests/pos/typers.scala
index 900baef75..66c10f4b0 100644
--- a/tests/pos/typers.scala
+++ b/tests/pos/typers.scala
@@ -1,3 +1,5 @@
+import annotation.tailrec
+
object typers {
class List[+T] {
@@ -43,6 +45,12 @@ object typers {
}
class C {
+
+ @tailrec def factorial(acc: Int, n: Int): Int =
+ if (n == 0) acc
+ else factorial(acc * n, n - 1)
+
+ println(factorial(1, 10))
}
class Refinements {