We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 356dbb3 + c211343 commit 6e27e97Copy full SHA for 6e27e97
tests/pos/i9781.scala
@@ -0,0 +1,19 @@
1
+trait Txn[T <: Txn[T]]
2
+
3
+trait Elem[T <: Txn[T]]
4
5
+sealed trait State[+T]
6
+final case class Done[T <: Txn[T]](elem: Elem[T]) extends State[T]
7
+case object Busy extends State[Nothing]
8
9
+trait Test[Out <: Txn[Out]] {
10
+ def apply(opt: Option[State[Out]]): Any = opt match {
11
+ case Some(state) =>
12
+ state match {
13
+ case Done(out) => "foo" // problem here
14
+ case Busy => throw new IllegalStateException("Cyclic object graph")
15
+ }
16
17
+ case None => "bar"
18
19
+}
0 commit comments