From 1eb533b9f5e42a1517c4892f36bffcf46dde1228 Mon Sep 17 00:00:00 2001 From: Roman-Statsura Date: Wed, 8 May 2024 19:29:30 +0400 Subject: [PATCH] Add support Scala 3 for module observable --- build.sbt | 5 +++-- .../interop/zio2/core/src/main/scala/tofu/zioFunctions.scala | 2 +- .../src/test/scala/tofu/zioInstances/ZioInstancesSuite.scala | 4 ++-- .../tofu/observable/TakeWhileInclusive.scala | 0 .../main/{scala-2 => scala}/tofu/observable/package.scala | 0 .../tofu/observable/TakeWhileInclusiveSuite.scala | 0 6 files changed, 6 insertions(+), 5 deletions(-) rename modules/util/observable/src/main/{scala-2 => scala}/tofu/observable/TakeWhileInclusive.scala (100%) rename modules/util/observable/src/main/{scala-2 => scala}/tofu/observable/package.scala (100%) rename modules/util/observable/src/test/{scala-2 => scala}/tofu/observable/TakeWhileInclusiveSuite.scala (100%) diff --git a/build.sbt b/build.sbt index 17d9a573b..2f42ab686 100644 --- a/build.sbt +++ b/build.sbt @@ -292,11 +292,12 @@ lazy val observable = projectMatrix .in(util / "observable") .settings( defaultSettings, + scala3MigratedModuleOptions, libraryDependencies ++= Vector(monix, catsEffect2), libraryDependencies += scalatest, name := "tofu-observable", ) - .jvmPlatform(scala2Versions) + .jvmPlatform(scalaVersions = scala2And3Versions) lazy val config = projectMatrix .in(util / "config") @@ -344,7 +345,7 @@ lazy val zio2Core = projectMatrix libraryDependencies ++= List(zio2, zio2Cats), name := "tofu-zio2-core" ) - .jvmPlatform(scala2Versions) + .jvmPlatform(scalaVersions = scala2And3Versions) .dependsOn(coreCE3) lazy val zio1Logging = projectMatrix diff --git a/modules/interop/zio2/core/src/main/scala/tofu/zioFunctions.scala b/modules/interop/zio2/core/src/main/scala/tofu/zioFunctions.scala index 295d35d89..d8ce29ed9 100644 --- a/modules/interop/zio2/core/src/main/scala/tofu/zioFunctions.scala +++ b/modules/interop/zio2/core/src/main/scala/tofu/zioFunctions.scala @@ -9,7 +9,7 @@ import zio.{IO, ZIO, Tag => ZTag} import scala.annotation.nowarn object zioFunctions { - @nowarn("cat=unused-params") + @nowarn def expose[U[_[_, _]]: EmbedBK: FunctorBK: Tag.auto.T]: U[ZIO[U[IO], +_, +_]] = EmbedBK.of[ZIO[U[IO], +_, +_], U](ZIO.environmentWith(_.get[U[IO]](ZTag[U[IO]]).widenb)) } diff --git a/modules/interop/zio2/core/src/test/scala/tofu/zioInstances/ZioInstancesSuite.scala b/modules/interop/zio2/core/src/test/scala/tofu/zioInstances/ZioInstancesSuite.scala index 49df5903a..541faad79 100644 --- a/modules/interop/zio2/core/src/test/scala/tofu/zioInstances/ZioInstancesSuite.scala +++ b/modules/interop/zio2/core/src/test/scala/tofu/zioInstances/ZioInstancesSuite.scala @@ -40,7 +40,7 @@ object ZioInstancesSuite { () } - @nowarn("cat=unused-params") + @nowarn def summonZioInstances[E, Env: Tag, Ctx: Tag](): Unit = { implicitly[WithRun[ZIO[Env with Ctx, E, _], ZIO[Env, E, _], Ctx]] implicitly[WithRun[ZIO[Ctx with Env, E, _], ZIO[Env, E, _], Ctx]] @@ -49,7 +49,7 @@ object ZioInstancesSuite { () } - @nowarn("cat=unused-params") + @nowarn def taskAmbiguity: Any = { import cats.effect.Sync import tofu.Raise diff --git a/modules/util/observable/src/main/scala-2/tofu/observable/TakeWhileInclusive.scala b/modules/util/observable/src/main/scala/tofu/observable/TakeWhileInclusive.scala similarity index 100% rename from modules/util/observable/src/main/scala-2/tofu/observable/TakeWhileInclusive.scala rename to modules/util/observable/src/main/scala/tofu/observable/TakeWhileInclusive.scala diff --git a/modules/util/observable/src/main/scala-2/tofu/observable/package.scala b/modules/util/observable/src/main/scala/tofu/observable/package.scala similarity index 100% rename from modules/util/observable/src/main/scala-2/tofu/observable/package.scala rename to modules/util/observable/src/main/scala/tofu/observable/package.scala diff --git a/modules/util/observable/src/test/scala-2/tofu/observable/TakeWhileInclusiveSuite.scala b/modules/util/observable/src/test/scala/tofu/observable/TakeWhileInclusiveSuite.scala similarity index 100% rename from modules/util/observable/src/test/scala-2/tofu/observable/TakeWhileInclusiveSuite.scala rename to modules/util/observable/src/test/scala/tofu/observable/TakeWhileInclusiveSuite.scala