Skip to content

Commit

Permalink
Update scala3-library to 3.4.1 (#33)
Browse files Browse the repository at this point in the history
* Update scala3-library to 3.4.1

* Regenerate GitHub Actions workflow

Executed command: sbt githubWorkflowGenerate

* Fix compilation for scala 3.4

---------

Co-authored-by: Michael Nedokushev <[email protected]>
  • Loading branch information
scala-steward and grouzen authored Aug 9, 2024
1 parent 78ddaca commit 981d6e0
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [2.12.19, 2.13.14, 3.3.3]
scala: [2.12.19, 2.13.14, 3.4.1]
java: [temurin@11, temurin@17]
runs-on: ${{ matrix.os }}
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import zio.Chunk

object Schemas {

abstract class Def[Self <: Def[_]] {
abstract class Def[Self <: Def[?]] {

def named(name: String): Type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ object SchemaEncoderDeriver {

override def deriveRecord[A](
record: Schema.Record[A],
fields: => Chunk[Deriver.WrappedF[SchemaEncoder, _]],
fields: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]],
summoned: => Option[SchemaEncoder[A]]
): SchemaEncoder[A] = new SchemaEncoder[A] {

private def enc[A1](name0: String, schema0: Schema[A1], encoder: SchemaEncoder[_]) =
private def enc[A1](name0: String, schema0: Schema[A1], encoder: SchemaEncoder[?]) =
encoder.asInstanceOf[SchemaEncoder[A1]].encode(schema0, name0, isSchemaOptional(schema0))

override def encode(schema: Schema[A], name: String, optional: Boolean): Type = {
Expand All @@ -30,7 +30,7 @@ object SchemaEncoderDeriver {

override def deriveEnum[A](
`enum`: Schema.Enum[A],
cases: => Chunk[Deriver.WrappedF[SchemaEncoder, _]],
cases: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]],
summoned: => Option[SchemaEncoder[A]]
): SchemaEncoder[A] = new SchemaEncoder[A] {
override def encode(schema: Schema[A], name: String, optional: Boolean): Type =
Expand Down Expand Up @@ -121,7 +121,7 @@ object SchemaEncoderDeriver {
}

override def deriveSequence[C[_], A](
sequence: Schema.Sequence[C[A], A, _],
sequence: Schema.Sequence[C[A], A, ?],
inner: => SchemaEncoder[A],
summoned: => Option[SchemaEncoder[C[A]]]
): SchemaEncoder[C[A]] = new SchemaEncoder[C[A]] {
Expand Down Expand Up @@ -150,16 +150,16 @@ object SchemaEncoderDeriver {

override def deriveTransformedRecord[A, B](
record: Schema.Record[A],
transform: Schema.Transform[A, B, _],
fields: => Chunk[Deriver.WrappedF[SchemaEncoder, _]],
transform: Schema.Transform[A, B, ?],
fields: => Chunk[Deriver.WrappedF[SchemaEncoder, ?]],
summoned: => Option[SchemaEncoder[B]]
): SchemaEncoder[B] = ???

}.cached

val summoned: Deriver[SchemaEncoder] = default.autoAcceptSummoned

private def isSchemaOptional(schema: Schema[_]): Boolean =
private def isSchemaOptional(schema: Schema[?]): Boolean =
schema match {
case _: Schema.Optional[_] => true
case _ => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object ValueDecoderDeriver {

override def deriveRecord[A](
record: Schema.Record[A],
fields: => Chunk[Deriver.WrappedF[ValueDecoder, _]],
fields: => Chunk[Deriver.WrappedF[ValueDecoder, ?]],
summoned: => Option[ValueDecoder[A]]
): ValueDecoder[A] = new ValueDecoder[A] {
override def decode(value: Value): A =
Expand Down Expand Up @@ -62,7 +62,7 @@ object ValueDecoderDeriver {

override def deriveEnum[A](
`enum`: Schema.Enum[A],
cases: => Chunk[Deriver.WrappedF[ValueDecoder, _]],
cases: => Chunk[Deriver.WrappedF[ValueDecoder, ?]],
summoned: => Option[ValueDecoder[A]]
): ValueDecoder[A] = new ValueDecoder[A] {
override def decode(value: Value): A = {
Expand Down Expand Up @@ -180,7 +180,7 @@ object ValueDecoderDeriver {
}

override def deriveSequence[C[_], A](
sequence: Schema.Sequence[C[A], A, _],
sequence: Schema.Sequence[C[A], A, ?],
inner: => ValueDecoder[A],
summoned: => Option[ValueDecoder[C[A]]]
): ValueDecoder[C[A]] = new ValueDecoder[C[A]] {
Expand Down Expand Up @@ -212,8 +212,8 @@ object ValueDecoderDeriver {

override def deriveTransformedRecord[A, B](
record: Schema.Record[A],
transform: Schema.Transform[A, B, _],
fields: => Chunk[Deriver.WrappedF[ValueDecoder, _]],
transform: Schema.Transform[A, B, ?],
fields: => Chunk[Deriver.WrappedF[ValueDecoder, ?]],
summoned: => Option[ValueDecoder[B]]
): ValueDecoder[B] = ???

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ object ValueEncoderDeriver {

override def deriveRecord[A](
record: Schema.Record[A],
fields: => Chunk[Deriver.WrappedF[ValueEncoder, _]],
fields: => Chunk[Deriver.WrappedF[ValueEncoder, ?]],
summoned: => Option[ValueEncoder[A]]
): ValueEncoder[A] = new ValueEncoder[A] {

private def enc[A1](v: A, field: Schema.Field[A, A1], encoder: ValueEncoder[_]) =
private def enc[A1](v: A, field: Schema.Field[A, A1], encoder: ValueEncoder[?]) =
encoder.asInstanceOf[ValueEncoder[A1]].encode(field.get(v))

override def encode(value: A): Value =
Expand All @@ -51,7 +51,7 @@ object ValueEncoderDeriver {

override def deriveEnum[A](
`enum`: Schema.Enum[A],
cases: => Chunk[Deriver.WrappedF[ValueEncoder, _]],
cases: => Chunk[Deriver.WrappedF[ValueEncoder, ?]],
summoned: => Option[ValueEncoder[A]]
): ValueEncoder[A] = new ValueEncoder[A] {
override def encode(value: A): Value = {
Expand Down Expand Up @@ -151,7 +151,7 @@ object ValueEncoderDeriver {
}

override def deriveSequence[C[_], A](
sequence: Schema.Sequence[C[A], A, _],
sequence: Schema.Sequence[C[A], A, ?],
inner: => ValueEncoder[A],
summoned: => Option[ValueEncoder[C[A]]]
): ValueEncoder[C[A]] = new ValueEncoder[C[A]] {
Expand All @@ -175,8 +175,8 @@ object ValueEncoderDeriver {

override def deriveTransformedRecord[A, B](
record: Schema.Record[A],
transform: Schema.Transform[A, B, _],
fields: => Chunk[Deriver.WrappedF[ValueEncoder, _]],
transform: Schema.Transform[A, B, ?],
fields: => Chunk[Deriver.WrappedF[ValueEncoder, ?]],
summoned: => Option[ValueEncoder[B]]
): ValueEncoder[B] = ???

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import scala.jdk.CollectionConverters._

abstract class GroupValueConverter[V <: GroupValue[V]](
schema: GroupType,
parent: Option[GroupValueConverter[_]] = None
parent: Option[GroupValueConverter[?]] = None
) extends GroupConverter { self =>

def get: V =
Expand All @@ -20,7 +20,7 @@ abstract class GroupValueConverter[V <: GroupValue[V]](
def put(name: String, value: Value): Unit =
this.groupValue = this.groupValue.put(name, value)

protected var groupValue: V = _
protected var groupValue: V = null.asInstanceOf[V]

private val converters: Chunk[Converter] =
Chunk.fromIterable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ class WriteSupport(schema: MessageType, metadata: Map[String, String]) extends H
consumer.endMessage()
}

private var consumer: RecordConsumer = _
private var consumer: RecordConsumer = null

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ object SchemaEncoderDeriverSpec extends ZIOSpecDefault {
}

// Helper for being able to extract type parameter A from a given schema in order to cast the type of encoder<
private def encode[A](encoder: SchemaEncoder[_], schema: Schema[A], name: String, optional: Boolean) =
private def encode[A](encoder: SchemaEncoder[?], schema: Schema[A], name: String, optional: Boolean) =
encoder.asInstanceOf[SchemaEncoder[A]].encode(schema, name, optional)

override def spec: Spec[TestEnvironment with Scope, Any] =
override def spec: Spec[TestEnvironment & Scope, Any] =
suite("SchemaEncoderDeriverSpec")(
test("primitive") {
def named(defs: List[PrimitiveDef], names: List[String]) =
defs.zip(names).map { case (schemaDef, name) =>
schemaDef.named(name)
}

val encoders: List[SchemaEncoder[_]] =
val encoders: List[SchemaEncoder[?]] =
List(
Derive.derive[SchemaEncoder, String](SchemaEncoderDeriver.default),
Derive.derive[SchemaEncoder, Boolean](SchemaEncoderDeriver.default),
Expand All @@ -47,7 +47,7 @@ object SchemaEncoderDeriverSpec extends ZIOSpecDefault {
Derive.derive[SchemaEncoder, Long](SchemaEncoderDeriver.default),
Derive.derive[SchemaEncoder, UUID](SchemaEncoderDeriver.default)
)
val schemas: List[Schema[_]] =
val schemas: List[Schema[?]] =
List(
Schema.primitive[String],
Schema.primitive[Boolean],
Expand Down Expand Up @@ -116,7 +116,7 @@ object SchemaEncoderDeriverSpec extends ZIOSpecDefault {
},
test("sequence") {
val name = "mylist"
val encoders: List[SchemaEncoder[_]] =
val encoders: List[SchemaEncoder[?]] =
List(
Derive.derive[SchemaEncoder, List[String]](SchemaEncoderDeriver.default),
Derive.derive[SchemaEncoder, List[Boolean]](SchemaEncoderDeriver.default),
Expand All @@ -133,7 +133,7 @@ object SchemaEncoderDeriverSpec extends ZIOSpecDefault {
Derive.derive[SchemaEncoder, List[Option[Long]]](SchemaEncoderDeriver.default),
Derive.derive[SchemaEncoder, List[Option[UUID]]](SchemaEncoderDeriver.default)
)
val schemas: List[Schema[_]] =
val schemas: List[Schema[?]] =
List(
Schema.list[String],
Schema.list[Int],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object ValueCodecDeriverSpec extends ZIOSpecDefault {
implicit val schema: Schema[SummonedRecord] = DeriveSchema.gen[SummonedRecord]
}

override def spec: Spec[TestEnvironment with Scope, Any] =
override def spec: Spec[TestEnvironment & Scope, Any] =
suite("ValueCodecDeriverSpec")(
test("primitive") {
val stringEncoder = Derive.derive[ValueEncoder, String](ValueEncoderDeriver.default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ object ParquetIOSpec extends ZIOSpecDefault {
Derive.derive[ValueDecoder, ProjectedRecord](ValueDecoderDeriver.summoned)
}

override def spec: Spec[TestEnvironment with Scope, Any] =
override def spec: Spec[TestEnvironment & Scope, Any] =
suite("ParquetIOSpec")(
test("write and read - chunk") {
val payload = Chunk(
Expand Down
2 changes: 1 addition & 1 deletion project/BuildHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object BuildHelper {

val Scala212 = "2.12.19"
val Scala213 = "2.13.14"
val Scala3 = "3.3.3"
val Scala3 = "3.4.1"

private def betterMonadicFor(scalaVersion: String) =
CrossVersion.partialVersion(scalaVersion) match {
Expand Down

0 comments on commit 981d6e0

Please sign in to comment.