We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 497cdc2 commit 216ac17Copy full SHA for 216ac17
tests/patmat/t11649.scala
@@ -0,0 +1,7 @@
1
+sealed trait Command { type Err }
2
+final case class Kick() extends Command { type Err = String }
3
+final case class Box() extends Command { type Err = Int }
4
+def handle[E](cmd: Command {type Err = E}): Either[E, Unit] = cmd match {
5
+ case Kick() => ???
6
+ case Box() => ???
7
+}
0 commit comments