diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52ffe29c1..4d0c0ab28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: fail-fast: false matrix: java: ['adopt@1.8', 'adopt@1.11'] - scala: ['2.12.17', '2.13.8', '3.2.1'] + scala: ['2.12.17', '2.13.8', '3.3.0'] steps: - uses: actions/checkout@v3.0.0 with: diff --git a/README.md b/README.md index 243558c74..2e33a70fe 100644 --- a/README.md +++ b/README.md @@ -30,13 +30,13 @@ _ZIO Schema_ is used by a growing number of ZIO libraries, including _ZIO Flow_, In order to use this library, we need to add the following lines in our `build.sbt` file: ```scala -libraryDependencies += "dev.zio" %% "zio-schema" % "0.4.12" -libraryDependencies += "dev.zio" %% "zio-schema-bson" % "0.4.12" -libraryDependencies += "dev.zio" %% "zio-schema-json" % "0.4.12" -libraryDependencies += "dev.zio" %% "zio-schema-protobuf" % "0.4.12" +libraryDependencies += "dev.zio" %% "zio-schema" % "0.4.13" +libraryDependencies += "dev.zio" %% "zio-schema-bson" % "0.4.13" +libraryDependencies += "dev.zio" %% "zio-schema-json" % "0.4.13" +libraryDependencies += "dev.zio" %% "zio-schema-protobuf" % "0.4.13" // Required for automatic generic derivation of schemas -libraryDependencies += "dev.zio" %% "zio-schema-derivation" % "0.4.12", +libraryDependencies += "dev.zio" %% "zio-schema-derivation" % "0.4.13", libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided" ``` diff --git a/project/BuildHelper.scala b/project/BuildHelper.scala index 1448a489f..f2a0331aa 100644 --- a/project/BuildHelper.scala +++ b/project/BuildHelper.scala @@ -23,7 +23,7 @@ object BuildHelper { val Scala212: String = versions("2.12") val Scala213: String = versions("2.13") - val Scala3: String = versions("3.2") //versions.getOrElse("3.0", versions("3.1")) + val Scala3: String = versions("3.3") //versions.getOrElse("3.0", versions("3.1")) val zioVersion = "2.0.10" val zioJsonVersion = "0.5.0" diff --git a/zio-schema-derivation/shared/src/main/scala-3/zio/schema/Derive.scala b/zio-schema-derivation/shared/src/main/scala-3/zio/schema/Derive.scala index c33c8cdcf..b4c342f21 100644 --- a/zio-schema-derivation/shared/src/main/scala-3/zio/schema/Derive.scala +++ b/zio-schema-derivation/shared/src/main/scala-3/zio/schema/Derive.scala @@ -14,7 +14,9 @@ object Derive { DeriveInstance().deriveInstance[F, A](deriver, schema, top = true) } -private case class DeriveInstance()(using val ctx: Quotes) extends ReflectionUtils(ctx) { +private case class DeriveInstance()(using val ctx: Quotes) { + val reflectionUtils = ReflectionUtils(ctx) + import reflectionUtils.{MirrorType, Mirror, summonOptional} import ctx.reflect._ case class Frame(ref: Term, tpe: TypeRepr) diff --git a/zio-schema-derivation/shared/src/main/scala-3/zio/schema/DeriveSchema.scala b/zio-schema-derivation/shared/src/main/scala-3/zio/schema/DeriveSchema.scala index 4e67fd317..a7fac9e43 100644 --- a/zio-schema-derivation/shared/src/main/scala-3/zio/schema/DeriveSchema.scala +++ b/zio-schema-derivation/shared/src/main/scala-3/zio/schema/DeriveSchema.scala @@ -18,9 +18,11 @@ object DeriveSchema { DeriveSchema().deriveSchema[T](top = true) } -private case class DeriveSchema()(using val ctx: Quotes) extends ReflectionUtils(ctx) { +private case class DeriveSchema()(using val ctx: Quotes) { + val reflectionUtils = ReflectionUtils(ctx) + import reflectionUtils.{MirrorType, Mirror} import ctx.reflect._ - + case class Frame(ref: Term, tpe: TypeRepr) case class Stack(frames: List[Frame]) { def find(tpe: TypeRepr): Option[Term] = frames.find(_.tpe =:= tpe).map(_.ref)