diff --git a/build.sbt b/build.sbt index 0d19b13..615b245 100644 --- a/build.sbt +++ b/build.sbt @@ -41,8 +41,8 @@ inThisBuild { ThisBuild / scalacOptions ++= { CrossVersion.partialVersion(scalaVersion.value) match { - case Some((2, 12 | 13)) => - Seq( + case Some((2, minor @ (12 | 13))) => + val base = Seq( "-deprecation", "-encoding", "UTF-8", @@ -57,6 +57,8 @@ ThisBuild / scalacOptions ++= { "-Ywarn-unused", "-Xsource:3" ) + if (minor == 12) "-Ypartial-unification" +: base + else base case Some((3, _)) => Seq.empty diff --git a/src/main/scala/io/kaizensolutions/jsonschema/JsonSchemaDeserializer.scala b/src/main/scala/io/kaizensolutions/jsonschema/JsonSchemaDeserializer.scala index 74d7e71..a5e193f 100644 --- a/src/main/scala/io/kaizensolutions/jsonschema/JsonSchemaDeserializer.scala +++ b/src/main/scala/io/kaizensolutions/jsonschema/JsonSchemaDeserializer.scala @@ -17,21 +17,23 @@ import scala.reflect.ClassTag // See AbstractKafkaJsonSchemaDeserializer object JsonSchemaDeserializer { - def forValue[F[+_]: Sync, A: Decoder]( + def forValue[F[_]: Sync, A: Decoder]( settings: JsonSchemaDeserializerSettings, client: SchemaRegistryClient )(implicit jsonSchema: json.Schema[A], tag: ClassTag[A]): F[ValueDeserializer[F, A]] = toJsonSchema[F, A](jsonSchema, settings.jsonSchemaId) .flatMap(create(settings, client, _)) + .map(identity) - def forKey[F[+_]: Sync, A: Decoder]( + def forKey[F[_]: Sync, A: Decoder]( settings: JsonSchemaDeserializerSettings, client: SchemaRegistryClient )(implicit jsonSchema: json.Schema[A], tag: ClassTag[A]): F[KeyDeserializer[F, A]] = toJsonSchema[F, A](jsonSchema, settings.jsonSchemaId) .flatMap(create(settings, client, _)) + .map(identity) - def create[F[+_]: Sync, A: Decoder]( + def create[F[_]: Sync, A: Decoder]( settings: JsonSchemaDeserializerSettings, client: SchemaRegistryClient, schema: JsonSchema diff --git a/src/test/scala/io/kaizensolutions/jsonschema/JsonSchemaSerDesSpec.scala b/src/test/scala/io/kaizensolutions/jsonschema/JsonSchemaSerDesSpec.scala index 6ff2667..b5916e9 100644 --- a/src/test/scala/io/kaizensolutions/jsonschema/JsonSchemaSerDesSpec.scala +++ b/src/test/scala/io/kaizensolutions/jsonschema/JsonSchemaSerDesSpec.scala @@ -1,14 +1,14 @@ package io.kaizensolutions.jsonschema -import cats.effect._ -import cats.syntax.all._ +import cats.effect.* +import cats.syntax.all.* import com.dimafeng.testcontainers.DockerComposeContainer.ComposeFile import com.dimafeng.testcontainers.munit.TestContainersForAll import com.dimafeng.testcontainers.{DockerComposeContainer, ExposedService} import fs2.Stream -import fs2.kafka._ +import fs2.kafka.* import fs2.kafka.vulcan.SchemaRegistryClientSettings -import io.circe.generic.semiauto._ +import io.circe.generic.semiauto.* import io.circe.{Codec, Decoder, Encoder} import io.confluent.kafka.schemaregistry.client.SchemaRegistryClient import io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException @@ -232,7 +232,7 @@ class JsonSchemaSerDesSpec extends CatsEffectSuite with TestContainersForAll { assertion(produceElements) } - def consumeFromKafka[F[+_]: Async, A: Decoder: json.Schema: ClassTag]( + def consumeFromKafka[F[_]: Async, A: Decoder: json.Schema: ClassTag]( fClient: F[SchemaRegistryClient], settings: JsonSchemaDeserializerSettings, groupId: String,