aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/tailcall/t4649.scala
blob: 5f009b7a496edeccc3a231040e5b8e42ae5949e6 (plain) (tree)
1
2
3
4
5
6
                 




                                                                          
object Test4649 {
  // @annotation.tailrec
  def lazyFilter[E](s: Stream[E], p: E => Boolean): Stream[E] = s match {
    case h #:: t => if (p(h)) h #:: lazyFilter(t, p) else lazyFilter(t, p)
  }
}