aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/tailcall/i1221.scala
blob: 7cf9312f5f03a0370f385b544db5aadf35a17dcb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import annotation.tailrec

object I1221{
  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
  }
}