blob: b0c56061527d0911a22137b3a5a85fa2f71c6c0a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import annotation.tailrec
object Test {
@tailrec private def quux(xs: List[String]): List[String] = quux(quux(xs)) // error
@tailrec private def quux2(xs: List[String]): List[String] = xs match {
case x1 :: x2 :: rest => quux2(x1 :: quux2(rest)) // error
case _ => Nil
}
@tailrec private def quux3(xs: List[String]): Boolean = xs match {
case x :: xs if quux3(List("abc")) => quux3(xs)
case _ => false
}
}
|