Skip to content

Commit 5270291

Browse files
committed
Use explicit kinds for type parameters
Avoid errors after scala/scala3#9086
1 parent 26c04f5 commit 5270291

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/scala/ProcessDSL.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ case object RecY extends RecY[Unit]
5959
sealed abstract class RecZ[A]() extends RecVar[A]("Z")
6060
case object RecZ extends RecZ[Unit]
6161

62-
case class Def[V <: ProcVar, A, P1 <: Process, P2 <: Process](name: V[A], pdef: A => P1, in: () => P2) extends Process
63-
case class Call[V <: ProcVar, A](procvar: V[A], arg: A) extends Process
62+
case class Def[V[X] <: ProcVar[X], A, P1 <: Process, P2 <: Process](name: V[A], pdef: A => P1, in: () => P2) extends Process
63+
case class Call[V[X] <: ProcVar[X], A](procvar: V[A], arg: A) extends Process
6464

6565
case class >>:[P1 <: Process, P2 <: Process](p1: () => P1, p2: () => P2) extends Process
6666

6767
package object dsl {
6868
/** Recursion: `P` loops on `V`, that represent a bound recursion variable. */
69-
type Rec[V <: RecVar, P <: Process] = Def[V, Unit, P, P]
69+
type Rec[V[X] <: RecVar[X], P <: Process] = Def[V, Unit, P, P]
7070

7171
/** Loop on a recursion variable `V`, expected to be bound by [[Rec]].*/
72-
type Loop[V <: RecVar] = Call[V, Unit]
72+
type Loop[V[X] <: RecVar[X]] = Call[V, Unit]
7373

7474
/** Execute `P1` and `P2` in parallel. */
7575
type Par[P1 <: Process, P2 <: Process] = Fork[P1] >>: P2
@@ -270,13 +270,13 @@ package object dsl {
270270
Yield[A](v)(Some(implicitly[YieldCtx[A]]))
271271
}
272272

273-
def pdef[V <: ProcVar, A, P1 <: Process, P2 <: Process](name: V[A])(pdef: A => P1)(in: => P2) = Def[V, A, P1, P2](name, pdef, () => in)
273+
def pdef[V[X] <: ProcVar[X], A, P1 <: Process, P2 <: Process](name: V[A])(pdef: A => P1)(in: => P2) = Def[V, A, P1, P2](name, pdef, () => in)
274274

275-
def pcall[V <: ProcVar, A](name: V[A], arg: A) = Call[V,A](name, arg)
275+
def pcall[V[X] <: ProcVar[X], A](name: V[A], arg: A) = Call[V,A](name, arg)
276276

277-
def rec[V <: RecVar, P <: Process](v: V[Unit])(p: => P): Rec[V, P] = Def[V, Unit, P, P](v, (x) => p, () => p)
277+
def rec[V[X] <: RecVar[X], P <: Process](v: V[Unit])(p: => P): Rec[V, P] = Def[V, Unit, P, P](v, (x) => p, () => p)
278278

279-
def loop[V <: RecVar](v: V[Unit]): Loop[V] = Call[V, Unit](v, ())
279+
def loop[V[X] <: RecVar[X]](v: V[Unit]): Loop[V] = Call[V, Unit](v, ())
280280

281281
def eval(p: Process): Try[Unit] = Try(eval(Map(), Nil, p))
282282

0 commit comments

Comments
 (0)