We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cd6998 commit ba74d25Copy full SHA for ba74d25
tests/pos/i9841b.scala
@@ -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