From 5cd592f79474688713feb93c6bbc7172bbe97b2f Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Tue, 31 Dec 2024 14:30:38 +0200 Subject: [PATCH] Fix compilation issue --- .../scala/org/typelevel/otel4s/context/LocalProvider.scala | 2 +- .../typelevel/otel4s/oteljava/IOLocalContextStorage.scala | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/common/src/main/scala/org/typelevel/otel4s/context/LocalProvider.scala b/core/common/src/main/scala/org/typelevel/otel4s/context/LocalProvider.scala index 5749c36c8..635b543c7 100644 --- a/core/common/src/main/scala/org/typelevel/otel4s/context/LocalProvider.scala +++ b/core/common/src/main/scala/org/typelevel/otel4s/context/LocalProvider.scala @@ -130,7 +130,7 @@ object LocalProvider extends LocalProviderLowPriority { /** Cats Effect 3.6 introduced `IOLocal#asLocal`. However, we need a variation for a polymorphic type. */ - private def localForIOLocal[F[_]: MonadCancelThrow: LiftIO, Ctx](ioLocal: IOLocal[Ctx]): Local[F, Ctx] = + private[otel4s] def localForIOLocal[F[_]: MonadCancelThrow: LiftIO, Ctx](ioLocal: IOLocal[Ctx]): Local[F, Ctx] = new Local[F, Ctx] { def applicative: Applicative[F] = Applicative[F] diff --git a/oteljava/context-storage/src/main/scala/org/typelevel/otel4s/oteljava/IOLocalContextStorage.scala b/oteljava/context-storage/src/main/scala/org/typelevel/otel4s/oteljava/IOLocalContextStorage.scala index 375be21c6..6dab114e5 100644 --- a/oteljava/context-storage/src/main/scala/org/typelevel/otel4s/oteljava/IOLocalContextStorage.scala +++ b/oteljava/context-storage/src/main/scala/org/typelevel/otel4s/oteljava/IOLocalContextStorage.scala @@ -25,7 +25,6 @@ import io.opentelemetry.context.{Context => JContext} import io.opentelemetry.context.ContextStorage import io.opentelemetry.context.Scope import org.typelevel.otel4s.context.LocalProvider -import org.typelevel.otel4s.instances.local._ import org.typelevel.otel4s.oteljava.context.Context import org.typelevel.otel4s.oteljava.context.LocalContext @@ -35,7 +34,7 @@ import org.typelevel.otel4s.oteljava.context.LocalContext * and stay in sync as long as effects are threaded properly. */ class IOLocalContextStorage(_ioLocal: () => IOLocal[Context]) extends ContextStorage { - private[this] implicit lazy val ioLocal: IOLocal[Context] = _ioLocal() + private[this] lazy val ioLocal: IOLocal[Context] = _ioLocal() private[this] lazy val unsafeThreadLocal: ThreadLocal[Context] = { val fiberLocal = ioLocal.unsafeThreadLocal() @@ -67,7 +66,7 @@ class IOLocalContextStorage(_ioLocal: () => IOLocal[Context]) extends ContextSto * a [[cats.mtl.Local `Local`]] of a [[org.typelevel.otel4s.oteljava.context.Context `Context`]] that reflects the * state of the backing `IOLocal` */ - def local[F[_]: MonadCancelThrow: LiftIO]: LocalContext[F] = implicitly + def local[F[_]: MonadCancelThrow: LiftIO]: LocalContext[F] = LocalProvider.localForIOLocal(ioLocal) } object IOLocalContextStorage {