Skip to content

Commit

Permalink
Add test for tailcall
Browse files Browse the repository at this point in the history
Test for order of type parameters in recursive call
  • Loading branch information
DarkDimius committed Jul 22, 2014
1 parent b4e7de0 commit 601b11e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/pos/tailcall/tailcall.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ class tailcall {
final def fact(x: Int, acc: Int = 1): Int = if (x == 0) acc else fact(x - shift, acc * x)
def id[T <: AnyRef](x: T): T = if (x eq null) x else id(x)
}

class TypedApply[T2]{
private def firstDiff[T <: TypedApply[T2]](xs: List[T]): Int = firstDiff(xs)
}

0 comments on commit 601b11e

Please sign in to comment.