diff --git a/build.sbt b/build.sbt index 4fd7a651..d8ff0613 100644 --- a/build.sbt +++ b/build.sbt @@ -47,7 +47,7 @@ lazy val root = project unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library") ) -val zioVersion = "2.0.0-RC1" +val zioVersion = "2.0.0-RC2" val catsVersion = "2.6.1" val catsEffectVersion = "3.2.9" val catsMtlVersion = "1.2.1" diff --git a/zio-interop-cats-tests/shared/src/test/scala/zio/interop/CatsSpecBase.scala b/zio-interop-cats-tests/shared/src/test/scala/zio/interop/CatsSpecBase.scala index 76a1c28b..2328c9b0 100644 --- a/zio-interop-cats-tests/shared/src/test/scala/zio/interop/CatsSpecBase.scala +++ b/zio-interop-cats-tests/shared/src/test/scala/zio/interop/CatsSpecBase.scala @@ -118,7 +118,7 @@ private[zio] trait CatsSpecBase } } - implicit def eqForURIO[R: Arbitrary: Tag: IsNotIntersection, A: Eq](implicit ticker: Ticker): Eq[URIO[R, A]] = + implicit def eqForURIO[R: Arbitrary: Tag, A: Eq](implicit ticker: Ticker): Eq[URIO[R, A]] = eqForZIO[R, Nothing, A] implicit def execRIO(rio: RIO[ZEnv, Boolean])(implicit ticker: Ticker): Prop = @@ -127,7 +127,7 @@ private[zio] trait CatsSpecBase implicit def orderForUIOofFiniteDuration(implicit ticker: Ticker): Order[UIO[FiniteDuration]] = Order.by(unsafeRun(_).toEither.toOption) - implicit def orderForRIOofFiniteDuration[R: Arbitrary: Tag: IsNotIntersection](implicit + implicit def orderForRIOofFiniteDuration[R: Arbitrary: Tag](implicit ticker: Ticker ): Order[RIO[R, FiniteDuration]] = (x, y) => @@ -139,12 +139,12 @@ private[zio] trait CatsSpecBase implicit def eqForUManaged[A: Eq](implicit ticker: Ticker): Eq[UManaged[A]] = zManagedEq[Any, Nothing, A] - implicit def eqForURManaged[R: Arbitrary: Tag: IsNotIntersection, A: Eq](implicit + implicit def eqForURManaged[R: Arbitrary: Tag, A: Eq](implicit ticker: Ticker ): Eq[URManaged[R, A]] = zManagedEq[R, Nothing, A] - implicit def cogenZIO[R: Arbitrary: Tag: IsNotIntersection, E: Cogen, A: Cogen](implicit + implicit def cogenZIO[R: Arbitrary: Tag, E: Cogen, A: Cogen](implicit ticker: Ticker ): Cogen[ZIO[R, E, A]] = Cogen[Outcome[Option, E, A]].contramap { (zio: ZIO[R, E, A]) => @@ -172,11 +172,11 @@ private[interop] sealed trait CatsSpecBaseLowPriority { this: CatsSpecBase => implicit def eqForIO[E: Eq, A: Eq](implicit ticker: Ticker): Eq[IO[E, A]] = Eq.by(_.either) - implicit def eqForZIO[R: Arbitrary: Tag: IsNotIntersection, E: Eq, A: Eq](implicit ticker: Ticker): Eq[ZIO[R, E, A]] = + implicit def eqForZIO[R: Arbitrary: Tag, E: Eq, A: Eq](implicit ticker: Ticker): Eq[ZIO[R, E, A]] = (x, y) => Arbitrary.arbitrary[ZEnvironment[R]].sample.exists(r => x.provideEnvironment(r) eqv y.provideEnvironment(r)) - implicit def eqForRIO[R: Arbitrary: Tag: IsNotIntersection, A: Eq](implicit ticker: Ticker): Eq[RIO[R, A]] = + implicit def eqForRIO[R: Arbitrary: Tag, A: Eq](implicit ticker: Ticker): Eq[RIO[R, A]] = eqForZIO[R, Throwable, A] implicit def eqForTask[A: Eq](implicit ticker: Ticker): Eq[Task[A]] = @@ -187,13 +187,13 @@ private[interop] sealed trait CatsSpecBaseLowPriority { this: CatsSpecBase => ZManaged.ReleaseMap.make.flatMap(rm => ZManaged.currentReleaseMap.locally(rm)(managed.zio.map(_._2))) ) - implicit def eqForRManaged[R: Arbitrary: Tag: IsNotIntersection, A: Eq](implicit ticker: Ticker): Eq[RManaged[R, A]] = + implicit def eqForRManaged[R: Arbitrary: Tag, A: Eq](implicit ticker: Ticker): Eq[RManaged[R, A]] = zManagedEq[R, Throwable, A] implicit def eqForManaged[E: Eq, A: Eq](implicit ticker: Ticker): Eq[Managed[E, A]] = zManagedEq[Any, E, A] - implicit def eqForZManaged[R: Arbitrary: Tag: IsNotIntersection, E: Eq, A: Eq](implicit + implicit def eqForZManaged[R: Arbitrary: Tag, E: Eq, A: Eq](implicit ticker: Ticker ): Eq[ZManaged[R, E, A]] = zManagedEq[R, E, A] @@ -201,6 +201,6 @@ private[interop] sealed trait CatsSpecBaseLowPriority { this: CatsSpecBase => implicit def eqForTaskManaged[A: Eq](implicit ticker: Ticker): Eq[TaskManaged[A]] = zManagedEq[Any, Throwable, A] - implicit def arbitraryZEnvironment[R: Arbitrary: Tag: IsNotIntersection]: Arbitrary[ZEnvironment[R]] = + implicit def arbitraryZEnvironment[R: Arbitrary: Tag]: Arbitrary[ZEnvironment[R]] = Arbitrary(Arbitrary.arbitrary[R].map(ZEnvironment(_))) } diff --git a/zio-interop-cats-tests/shared/src/test/scala/zio/interop/ZioSpecBase.scala b/zio-interop-cats-tests/shared/src/test/scala/zio/interop/ZioSpecBase.scala index 3bebf43c..0880326a 100644 --- a/zio-interop-cats-tests/shared/src/test/scala/zio/interop/ZioSpecBase.scala +++ b/zio-interop-cats-tests/shared/src/test/scala/zio/interop/ZioSpecBase.scala @@ -8,13 +8,13 @@ private[interop] trait ZioSpecBase extends CatsSpecBase with ZioSpecBaseLowPrior implicit def arbitraryUIO[A: Arbitrary]: Arbitrary[UIO[A]] = Arbitrary(genUIO[A]) - implicit def arbitraryURIO[R: Cogen: Tag: IsNotIntersection, A: Arbitrary]: Arbitrary[URIO[R, A]] = + implicit def arbitraryURIO[R: Cogen: Tag, A: Arbitrary]: Arbitrary[URIO[R, A]] = Arbitrary(Arbitrary.arbitrary[ZEnvironment[R] => UIO[A]].map(ZIO.environment[R].flatMap)) implicit def arbitraryUManaged[A: Arbitrary]: Arbitrary[UManaged[A]] = zManagedArbitrary[Any, Nothing, A](arbitraryUIO[A]) - implicit def arbitraryURManaged[R: Cogen: Tag: IsNotIntersection, A: Arbitrary]: Arbitrary[URManaged[R, A]] = + implicit def arbitraryURManaged[R: Cogen: Tag, A: Arbitrary]: Arbitrary[URManaged[R, A]] = zManagedArbitrary[R, Nothing, A] implicit def arbitraryClockAndBlocking(implicit ticker: Ticker): Arbitrary[Clock] = @@ -34,11 +34,10 @@ private[interop] trait ZioSpecBaseLowPriority { self: ZioSpecBase => Arbitrary(Gen.oneOf(genIO[E, A], genLikeTrans(genIO[E, A]), genIdentityTrans(genIO[E, A]))) } - implicit def arbitraryZIO[R: Cogen: Tag: IsNotIntersection, E: CanFail: Arbitrary: Cogen, A: Arbitrary: Cogen] - : Arbitrary[ZIO[R, E, A]] = + implicit def arbitraryZIO[R: Cogen: Tag, E: CanFail: Arbitrary: Cogen, A: Arbitrary: Cogen]: Arbitrary[ZIO[R, E, A]] = Arbitrary(Gen.function1[ZEnvironment[R], IO[E, A]](arbitraryIO[E, A].arbitrary).map(ZIO.environment[R].flatMap)) - implicit def arbitraryRIO[R: Cogen: Tag: IsNotIntersection, A: Arbitrary: Cogen]: Arbitrary[RIO[R, A]] = + implicit def arbitraryRIO[R: Cogen: Tag, A: Arbitrary: Cogen]: Arbitrary[RIO[R, A]] = arbitraryZIO[R, Throwable, A] implicit def arbitraryTask[A: Arbitrary: Cogen]: Arbitrary[Task[A]] = @@ -47,19 +46,19 @@ private[interop] trait ZioSpecBaseLowPriority { self: ZioSpecBase => def zManagedArbitrary[R, E, A](implicit zio: Arbitrary[ZIO[R, E, A]]): Arbitrary[ZManaged[R, E, A]] = Arbitrary(zio.arbitrary.map(ZManaged.fromZIO(_))) - implicit def arbitraryRManaged[R: Cogen: Tag: IsNotIntersection, A: Arbitrary: Cogen]: Arbitrary[RManaged[R, A]] = + implicit def arbitraryRManaged[R: Cogen: Tag, A: Arbitrary: Cogen]: Arbitrary[RManaged[R, A]] = zManagedArbitrary[R, Throwable, A] implicit def arbitraryManaged[E: Arbitrary: Cogen, A: Arbitrary: Cogen]: Arbitrary[Managed[E, A]] = zManagedArbitrary[Any, E, A] - implicit def arbitraryZManaged[R: Cogen: Tag: IsNotIntersection, E: Arbitrary: Cogen, A: Arbitrary: Cogen] + implicit def arbitraryZManaged[R: Cogen: Tag, E: Arbitrary: Cogen, A: Arbitrary: Cogen] : Arbitrary[ZManaged[R, E, A]] = zManagedArbitrary[R, E, A] implicit def arbitraryTaskManaged[A: Arbitrary: Cogen]: Arbitrary[TaskManaged[A]] = zManagedArbitrary[Any, Throwable, A] - implicit def cogenZEnvironment[R: Cogen: Tag: IsNotIntersection]: Cogen[ZEnvironment[R]] = + implicit def cogenZEnvironment[R: Cogen: Tag]: Cogen[ZEnvironment[R]] = Cogen[R].contramap(_.get) } diff --git a/zio-interop-cats-tests/shared/src/test/scala/zio/stream/interop/ZStreamSpecBase.scala b/zio-interop-cats-tests/shared/src/test/scala/zio/stream/interop/ZStreamSpecBase.scala index 3fb8563a..bb86ed31 100644 --- a/zio-interop-cats-tests/shared/src/test/scala/zio/stream/interop/ZStreamSpecBase.scala +++ b/zio-interop-cats-tests/shared/src/test/scala/zio/stream/interop/ZStreamSpecBase.scala @@ -5,7 +5,7 @@ import cats.syntax.all.* import org.scalacheck.{ Arbitrary, Cogen, Gen } import zio.interop.CatsSpecBase import zio.stream.* -import zio.{ CanFail, Chunk, IsNotIntersection, Tag, ZEnvironment, ZIO } +import zio.{ CanFail, Chunk, Tag, ZEnvironment, ZIO } private[interop] trait ZStreamSpecBase extends CatsSpecBase with ZStreamSpecBaseLowPriority with GenStreamInteropCats { @@ -27,7 +27,7 @@ private[interop] trait ZStreamSpecBaseLowPriority { self: ZStreamSpecBase => implicit def eqForStream[E: Eq, A: Eq](implicit ticker: Ticker): Eq[Stream[E, A]] = zStreamEq[Any, E, A] - implicit def eqForZStream[R: Arbitrary: Tag: IsNotIntersection, E: Eq, A: Eq](implicit + implicit def eqForZStream[R: Arbitrary: Tag, E: Eq, A: Eq](implicit ticker: Ticker ): Eq[ZStream[R, E, A]] = zStreamEq[R, E, A] @@ -38,7 +38,7 @@ private[interop] trait ZStreamSpecBaseLowPriority { self: ZStreamSpecBase => } implicit def arbitraryZStream[ - R: Cogen: Tag: IsNotIntersection, + R: Cogen: Tag, E: CanFail: Arbitrary: Cogen, A: Arbitrary: Cogen ]: Arbitrary[ZStream[R, E, A]] = Arbitrary( @@ -47,6 +47,6 @@ private[interop] trait ZStreamSpecBaseLowPriority { self: ZStreamSpecBase => .map(ZStream.fromZIO(ZIO.environment[R]).flatMap) ) - implicit def cogenZEnvironment[R: Cogen: Tag: IsNotIntersection]: Cogen[ZEnvironment[R]] = + implicit def cogenZEnvironment[R: Cogen: Tag]: Cogen[ZEnvironment[R]] = Cogen[R].contramap(_.get) }