Skip to content

Commit ba74d25

Browse files
committed
Add another test
1 parent 9cd6998 commit ba74d25

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/pos/i9841b.scala

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
trait Exec[T <: Exec[T]]
2+
3+
object Tree {
4+
sealed trait Next[+T, +PL, +P, +H, +A]
5+
6+
sealed trait Child[+T, +PL, +P, +H, +A]
7+
8+
sealed trait Branch[T <: Exec[T], PL, P, H, A] extends Child[T, PL, P, H, A] with NonEmpty[T, PL, P, H]
9+
10+
sealed trait NonEmpty[T <: Exec[T], PL, P, H]
11+
12+
case object Empty extends Next[Nothing, Nothing, Nothing, Nothing, Nothing]
13+
14+
sealed trait RightBranch[T <: Exec[T], PL, P, H, A] extends Next[T, PL, P, H, A] with Branch[T, PL, P, H, A]
15+
16+
trait BranchImpl[T <: Exec[T], PL, P, H, A] {
17+
def next: Next[T, PL, P, H, A]
18+
19+
def nextOption: Option[Branch[T, PL, P, H, A]] =
20+
next match { // crashes
21+
case b: RightBranch[T, PL, P, H, A] => Some(b)
22+
case Empty => None
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)