aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/tailcall/i1221.scala
blob: 5c3286e97a2d92621805973ed168d5ef57b35ae2 (plain) (blame)
1
2
3
4
5
6
7
8
9
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
  }
}