From b0851df9705a264aac490827aad791338edd65eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20W=C3=A4rnsberg?= Date: Tue, 21 Sep 2021 14:06:15 +0200 Subject: [PATCH 1/2] fix: Add co/contravariance for better type inference --- opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala | 2 +- .../main/scala/zio/telemetry/opentelemetry/TracingSyntax.scala | 2 +- .../src/main/scala/zio/telemetry/opentracing/package.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala b/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala index 6c6c80eb..4218b68c 100644 --- a/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala +++ b/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala @@ -7,7 +7,7 @@ import io.opencensus.trace.SpanContext import io.opencensus.trace.Span object syntax { - implicit final class OpenCensusZioOps[R, E, A](val effect: ZIO[R, E, A]) extends AnyVal { + implicit final class OpenCensusZioOps[-R, +E, +A](val effect: ZIO[R, E, A]) extends AnyVal { def span( name: String, kind: Span.Kind = null, diff --git a/opentelemetry/src/main/scala/zio/telemetry/opentelemetry/TracingSyntax.scala b/opentelemetry/src/main/scala/zio/telemetry/opentelemetry/TracingSyntax.scala index d6197eae..3b7b7754 100644 --- a/opentelemetry/src/main/scala/zio/telemetry/opentelemetry/TracingSyntax.scala +++ b/opentelemetry/src/main/scala/zio/telemetry/opentelemetry/TracingSyntax.scala @@ -8,7 +8,7 @@ import zio.clock.Clock object TracingSyntax { - implicit final class OpenTelemetryZioOps[R, E, A](val effect: ZIO[R, E, A]) extends AnyVal { + implicit final class OpenTelemetryZioOps[-R, +E, +A](val effect: ZIO[R, E, A]) extends AnyVal { def spanFrom[C]( propagator: TextMapPropagator, diff --git a/opentracing/src/main/scala/zio/telemetry/opentracing/package.scala b/opentracing/src/main/scala/zio/telemetry/opentracing/package.scala index 953dfaa5..73afeef2 100644 --- a/opentracing/src/main/scala/zio/telemetry/opentracing/package.scala +++ b/opentracing/src/main/scala/zio/telemetry/opentracing/package.scala @@ -6,7 +6,7 @@ import zio.{ Has, ZIO } package object opentracing { type OpenTracing = Has[OpenTracing.Service] - implicit final class OpenTracingZioOps[R, E, A](val zio: ZIO[R, E, A]) extends AnyVal { + implicit final class OpenTracingZioOps[-R, +E, +A](val zio: ZIO[R, E, A]) extends AnyVal { def root( operation: String, From fcfb2a496348eb9d0ca42bcbcc2d3b5eb3d988b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20W=C3=A4rnsberg?= Date: Tue, 21 Sep 2021 14:25:52 +0200 Subject: [PATCH 2/2] revert opencensus --- opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala b/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala index 4218b68c..6c6c80eb 100644 --- a/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala +++ b/opencensus/src/main/scala/zio/telemetry/opencensus/syntax.scala @@ -7,7 +7,7 @@ import io.opencensus.trace.SpanContext import io.opencensus.trace.Span object syntax { - implicit final class OpenCensusZioOps[-R, +E, +A](val effect: ZIO[R, E, A]) extends AnyVal { + implicit final class OpenCensusZioOps[R, E, A](val effect: ZIO[R, E, A]) extends AnyVal { def span( name: String, kind: Span.Kind = null,