Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
yoohaemin committed Mar 22, 2024
1 parent e966f82 commit 1d8b51c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ trait DecrelModuleBase
"-explaintypes",
"-Vimplicits",
"-Vtype-diffs",
"-P:kind-projector:underscore-placeholders"
"-P:kind-projector:underscore-placeholders",
"-Xmigration"
)

private val scalacOptions3 = scalacOptionsCommon ::: List(
Expand Down
4 changes: 2 additions & 2 deletions core/src/decrel/reify/Cache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import izumi.reflect.Tag
/**
* Simple cache implementation that is reusable across various integrations
*/
case class Cache private (
private[decrel] val entries: Map[Cache.Key[?, ?, ?], Cache.Entry[?, ?, ?]]
final case class Cache(
entries: Map[Cache.Key[?, ?, ?], Cache.Entry[?, ?, ?]]
) {

def add[Rel, A, B](relation: Rel & Relation[A, B], key: A, value: B)(implicit
Expand Down
6 changes: 3 additions & 3 deletions zquery/src/decrel/reify/zquery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ trait zquery[R] extends bifunctor.module[ZQuery[R, +*, +*]] {
ZIO.foldLeft(requests)(CompletedRequestMap.empty) { (crm, request) =>
resultsMap.get(request.id) match {
case Some(result) =>
ZIO.succeed(crm.insert(request)(Right(result)))
ZIO.succeed(crm.insert(request)(Exit.succeed(result)))
case None =>
ZIO.die(
new NoSuchElementException(s"Response for request not found: ${request.id}")
Expand All @@ -76,7 +76,7 @@ trait zquery[R] extends bifunctor.module[ZQuery[R, +*, +*]] {
}.catchAll { e =>
ZIO.succeed(
requests.foldLeft(CompletedRequestMap.empty) { (crm, request) =>
crm.insert(request)(Left(e))
crm.insert(request)(Exit.fail(e))
}
)
}
Expand Down Expand Up @@ -301,7 +301,7 @@ trait zquery[R] extends bifunctor.module[ZQuery[R, +*, +*]] {
val key: k.Input = k._key
val value: k.Result = v.valueEv(v._value)
Ref
.make[Option[Either[Nothing, k.Result]]](Some(Right(value)))
.make[Option[Exit[Nothing, k.Result]]](Some(Exit.succeed(value)))
.flatMap { value =>
zCache.put(
RelationRequest[k.R, k.Input, Nothing, k.Result](relation, key),
Expand Down

0 comments on commit 1d8b51c

Please sign in to comment.