Skip to content

Commit

Permalink
fixup! Cross-build to Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Sep 11, 2021
1 parent e994e7e commit 9e6d0c9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TransitionExecutorImpl[F[_], State](topology: ColoredPetriNet)(implicit

def fireTransition[Input, Output](
t: Transition[Input, Output, State]
): TransitionFunction[F, Input, Output, State] = { (consume, state, input) =>
): TransitionFunction[F, Input, Output, State] = { (consume: Marking, state: State, input: Input) =>
def handleFailure: PartialFunction[Throwable, F[(Marking, Output)]] = { case e: Throwable =>
errorHandling.raiseError(e).asInstanceOf[F[(Marking, Output)]]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait StateTransitionNet[S, E] {
)(fn: S => E): Transition[Unit, E, S] =
new AbstractTransition[Unit, E, S](id, label.getOrElse(s"t$id"), automated, Duration.Undefined, exceptionStrategy)
with UncoloredTransition[Unit, E, S] {
override val toString = label
override val toString = super.label
override val updateState = eventSourcing
override def produceEvent[F[_]](consume: Marking, state: S, input: Unit)(implicit sync: Sync[F]): F[E] =
Sync.apply.delay { (fn(state)) }
Expand Down
8 changes: 4 additions & 4 deletions api/src/main/scala/io/kagera/api/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ package object api {
def findTPEdge(from: T, to: P): Option[WLDiEdge[Either[P, T]]] =
graph.get(Right(from)).outgoing.find(_.target.value == Left(to)).map(_.toOuter)

def incomingPlaces(t: T): Set[P] = graph.get(t).incomingPlaces
def incomingPlaces(t: T): Set[P] = graph.get(t).incomingPlaces.asInstanceOf[Set[P]]

def incomingTransitions(p: P): Set[T] = graph.get(p).incomingTransitions
def incomingTransitions(p: P): Set[T] = graph.get(p).incomingTransitions.asInstanceOf[Set[T]]

def outgoingPlaces(t: T): Set[P] = graph.get(t).outgoingPlaces
def outgoingPlaces(t: T): Set[P] = graph.get(t).outgoingPlaces.asInstanceOf[Set[P]]

def outgoingTransitions(p: P): Set[T] = graph.get(p).outgoingTransitions
def outgoingTransitions(p: P): Set[T] = graph.get(p).outgoingTransitions.asInstanceOf[Set[T]]

def places() = graph.nodes.collect { case n if n.isPlace => n.asPlace }

Expand Down
6 changes: 2 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ inThisBuild(
val commonScalacOptions = Seq(
"-encoding",
"utf8",
"-target:jvm-1.8",
"-feature",
"-language:implicitConversions",
"-language:postfixOps",
"-unchecked",
"-deprecation",
"-Xlog-reflective-calls"
"-deprecation"
)

lazy val basicSettings =
Seq(
crossScalaVersions := Seq("3.0.2", "2.13.6", "2.12.14"),
crossScalaVersions := Seq("3.0.2", "2.13.6"),
scalaVersion := crossScalaVersions.value.head,
scalacOptions := commonScalacOptions
)
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object Dependencies {

val akkaPersistenceCassandra = "com.typesafe.akka" %% "akka-persistence-cassandra" % "1.0.5"

val scalaGraph = "org.scala-graph" %% "graph-core" % "1.13.1"
val scalaGraph = "org.scala-graph" %% "graph-core" % "1.13.3"
val scalaGraphDot = "org.scala-graph" %% "graph-dot" % "1.13.0"
val scalaJsDom = Def.setting("org.scala-js" %%% "scalajs-dom" % "1.2.0")
val scalaTags = Def.setting("com.lihaoyi" %%% "upickle" % "1.4.1")
Expand Down

0 comments on commit 9e6d0c9

Please sign in to comment.