Skip to content

Commit 601b11e

Browse files
committed
Add test for tailcall
Test for order of type parameters in recursive call
1 parent b4e7de0 commit 601b11e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/pos/tailcall/tailcall.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ class tailcall {
33
final def fact(x: Int, acc: Int = 1): Int = if (x == 0) acc else fact(x - shift, acc * x)
44
def id[T <: AnyRef](x: T): T = if (x eq null) x else id(x)
55
}
6+
7+
class TypedApply[T2]{
8+
private def firstDiff[T <: TypedApply[T2]](xs: List[T]): Int = firstDiff(xs)
9+
}

0 commit comments

Comments
 (0)