Skip to content

Commit e78a6e4

Browse files
committed
fix scala#6781: add regression test
1 parent a71dac9 commit e78a6e4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/pos/i6781.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
enum Nat {
2+
case Zero
3+
case Succ[N <: Nat](n: N)
4+
}
5+
import Nat._
6+
7+
inline def toInt(n: => Nat): Int = inline n match {
8+
case Zero => 0
9+
case Succ(n1) => toInt(n1) + 1
10+
}
11+
12+
val natTwo = toInt(Succ(Succ(Zero)))

0 commit comments

Comments
 (0)