Skip to content

Commit 3236b9d

Browse files
committed
Add test from scala#17147
1 parent 758b721 commit 3236b9d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import scala.annotation.tailrec
2+
3+
erased class Foo1
4+
class Foo2
5+
6+
@tailrec
7+
final def test1(n: Int, acc: Int): (Foo1, Foo2) ?=> Int =
8+
if n <= 0 then acc
9+
else test1(n - 1, acc * n)
10+
11+
@tailrec
12+
final def test2(n: Int, acc: Int): Foo1 ?=> Int =
13+
if n <= 0 then acc
14+
else test2(n - 1, acc * n)
15+
16+
@main def Test() =
17+
given Foo1 = Foo1()
18+
given Foo2 = Foo2()
19+
test1(10, 0)
20+
test2(10, 0)

0 commit comments

Comments
 (0)