aboutsummaryrefslogblamecommitdiff
path: root/tests/neg/tailcall/tailrec-3.scala
blob: b0c56061527d0911a22137b3a5a85fa2f71c6c0a (plain) (tree)
1
2
3
4
5
6


                         
                                                                                     
                                                                         
                                                                                     







                                                                    
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
  }
}