From eae6a4afef73a9f61196045b1c9c0f739d5f7ad3 Mon Sep 17 00:00:00 2001 From: Dawid Dworak Date: Tue, 27 Feb 2024 13:33:26 +0100 Subject: [PATCH] Scala 2.13.13 --- .github/workflows/ci.yml | 4 ++-- .../commons/serialization/GenCodecStructure.scala | 2 +- .../serialization/cbor/CborInputOutputTest.scala | 4 ++-- .../json/JsonStringInputOutputTest.scala | 6 +++--- .../commons/macros/meta/MacroMetadatas.scala | 2 +- .../avsystem/commons/macros/meta/MacroSymbols.scala | 12 ++++++------ .../avsystem/commons/mongo/typed/MongoFormat.scala | 4 ++-- .../avsystem/commons/mongo/typed/MongoOrder.scala | 4 ++-- project/Commons.scala | 2 +- .../com/avsystem/commons/redis/commands/geo.scala | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc242f3ba..3395cf768 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.12] + scala: [2.13.13] java: [temurin@11, temurin@17] runs-on: ${{ matrix.os }} steps: @@ -82,7 +82,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.12] + scala: [2.13.13] java: [temurin@11] runs-on: ${{ matrix.os }} steps: diff --git a/core/src/main/scala/com/avsystem/commons/serialization/GenCodecStructure.scala b/core/src/main/scala/com/avsystem/commons/serialization/GenCodecStructure.scala index ad8721142..dbae272cf 100644 --- a/core/src/main/scala/com/avsystem/commons/serialization/GenCodecStructure.scala +++ b/core/src/main/scala/com/avsystem/commons/serialization/GenCodecStructure.scala @@ -22,7 +22,7 @@ case class GenParamInfo[T]( @bincompat private[commons] def this( sourceName: String, annotName: Opt[name], hasWhenAbsent: Boolean, transientDefault: Boolean, outOfOrder: Boolean, flags: ParamFlags - ) = this(sourceName, annotName, false, hasWhenAbsent, transientDefault, outOfOrder, flags) + ) = this(sourceName, annotName, optional = false, hasWhenAbsent, transientDefault, outOfOrder, flags) } sealed trait GenCodecStructure[T] extends GenInfo[T] { diff --git a/core/src/test/scala/com/avsystem/commons/serialization/cbor/CborInputOutputTest.scala b/core/src/test/scala/com/avsystem/commons/serialization/cbor/CborInputOutputTest.scala index ddf7a5836..fa77ef529 100644 --- a/core/src/test/scala/com/avsystem/commons/serialization/cbor/CborInputOutputTest.scala +++ b/core/src/test/scala/com/avsystem/commons/serialization/cbor/CborInputOutputTest.scala @@ -192,7 +192,7 @@ class CborInputOutputTest extends AnyFunSuite { List( CustomKeysFlatUnion.IntCase(42), CustomKeysFlatUnion.StrCase("foo"), - CustomKeysFlatUnion.BoolCase(true), + CustomKeysFlatUnion.BoolCase(bool = true), CustomKeysFlatUnion.EmptyCase ), "9FA2000101182AA200020163666F6FA20068426F6F6C4361736564626F6F6CF5A10003FF" @@ -202,7 +202,7 @@ class CborInputOutputTest extends AnyFunSuite { List( CustomKeysNestedUnion.IntCase(42), CustomKeysNestedUnion.StrCase("foo"), - CustomKeysNestedUnion.BoolCase(true), + CustomKeysNestedUnion.BoolCase(bool = true), CustomKeysNestedUnion.EmptyCase ), "9FA101A101182AA102A10163666F6FA168426F6F6C43617365A164626F6F6CF5A103A0FF" diff --git a/core/src/test/scala/com/avsystem/commons/serialization/json/JsonStringInputOutputTest.scala b/core/src/test/scala/com/avsystem/commons/serialization/json/JsonStringInputOutputTest.scala index 629dbbe84..814296576 100644 --- a/core/src/test/scala/com/avsystem/commons/serialization/json/JsonStringInputOutputTest.scala +++ b/core/src/test/scala/com/avsystem/commons/serialization/json/JsonStringInputOutputTest.scala @@ -84,7 +84,7 @@ class JsonStringInputOutputTest extends AnyFunSuite with SerializationTestUtils roundtrip("strings")("", "a።bc\u0676ąቢść➔IJ") - roundtrip("simple case classes")(TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil)) + roundtrip("simple case classes")(TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil)) roundtrip("null")(null) @@ -189,8 +189,8 @@ class JsonStringInputOutputTest extends AnyFunSuite with SerializationTestUtils } test("serialize and deserialize nested case classes") { - val test: TestCC = TestCC(5, 123L, 432, true, "bla", 'a' :: 'b' :: Nil) - val test2: TestCC = TestCC(-35, 1L, 432, true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) + val test: TestCC = TestCC(5, 123L, 432, b = true, "bla", 'a' :: 'b' :: Nil) + val test2: TestCC = TestCC(-35, 1L, 432, b = true, "blsddf sdg \"{,}[,]\"a", 'a' :: 'b' :: Nil) val nested: NestedTestCC = NestedTestCC(-123, test, test2) val serialized = write(nested) val deserialized = read[NestedTestCC](serialized) diff --git a/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroMetadatas.scala b/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroMetadatas.scala index 2e70ca205..ceefb63ec 100644 --- a/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroMetadatas.scala +++ b/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroMetadatas.scala @@ -196,7 +196,7 @@ private[commons] trait MacroMetadatas extends MacroSymbols { """ protected def cast[C <: MetadataConstructor : ClassTag]: C = this match { - case c: C => c + case constructor: C => constructor case _ => throw new Exception(s"Metadata constructor $this is not a ${classTag[C].runtimeClass.getSimpleName}") } diff --git a/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroSymbols.scala b/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroSymbols.scala index 39d693466..a614c9d86 100644 --- a/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroSymbols.scala +++ b/macros/src/main/scala/com/avsystem/commons/macros/meta/MacroSymbols.scala @@ -97,9 +97,9 @@ private[commons] trait MacroSymbols extends MacroCommons { else param.reportProblem(s"forbidden RPC arity annotation: $at") } - case class Single(collectedType: Type) extends ParamArity(true) with Arity.Single - case class Optional(collectedType: Type) extends ParamArity(true) with Arity.Optional - case class Multi(collectedType: Type, named: Boolean) extends ParamArity(false) with Arity.Multi + case class Single(collectedType: Type) extends ParamArity(verbatimByDefault = true) with Arity.Single + case class Optional(collectedType: Type) extends ParamArity(verbatimByDefault = true) with Arity.Optional + case class Multi(collectedType: Type, named: Boolean) extends ParamArity(verbatimByDefault = false) with Arity.Multi } sealed abstract class MethodArity(val verbatimByDefault: Boolean) extends Arity @@ -112,9 +112,9 @@ private[commons] trait MacroSymbols extends MacroCommons { else method.reportProblem(s"unrecognized RPC method arity annotation: $at") } - case object Single extends MethodArity(true) with Arity.Single - case object Optional extends MethodArity(true) with Arity.Optional - case object Multi extends MethodArity(false) with Arity.Multi + case object Single extends MethodArity(verbatimByDefault = true) with Arity.Single + case object Optional extends MethodArity(verbatimByDefault = true) with Arity.Optional + case object Multi extends MethodArity(verbatimByDefault = false) with Arity.Multi } abstract class MacroSymbol { diff --git a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoFormat.scala b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoFormat.scala index b71e8194e..fff1cb1e3 100644 --- a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoFormat.scala +++ b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoFormat.scala @@ -170,8 +170,8 @@ object MongoAdtFormat extends AdtMetadataCompanion[MongoAdtFormat] { } // using collect (not map) because apparently scalac thinks the match is not exhaustive casesPerClass.valuesIterator.collect { - case (parent: SealedParent[p], cases) => - val subUnion = new UnionFormat(parent.info, codec.asInstanceOf[GenObjectCodec[p]], parent.classTag, flattenAnnot, cases.result()) + case (parent: SealedParent[p], parentCases) => + val subUnion = new UnionFormat(parent.info, codec.asInstanceOf[GenObjectCodec[p]], parent.classTag, flattenAnnot, parentCases.result()) (parent.classTag.runtimeClass, subUnion) }.toMap } diff --git a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala index 679ff60ae..266eb8586 100644 --- a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala +++ b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala @@ -16,8 +16,8 @@ sealed trait MongoOrder[T] { object MongoOrder { def unspecified[E]: MongoDocumentOrder[E] = MongoDocumentOrder.unspecified[E] - def ascending[T]: MongoOrder[T] = Simple(true) - def descending[T]: MongoOrder[T] = Simple(false) + def ascending[T]: MongoOrder[T] = Simple(ascending = true) + def descending[T]: MongoOrder[T] = Simple(ascending = false) def simple[T](ascending: Boolean): MongoOrder[T] = Simple(ascending) diff --git a/project/Commons.scala b/project/Commons.scala index f403e81f2..350f2e61b 100644 --- a/project/Commons.scala +++ b/project/Commons.scala @@ -69,7 +69,7 @@ object Commons extends ProjectGroup("commons") { Developer("ghik", "Roman Janusz", "r.janusz@avsystem.com", url("https://github.com/ghik")), ), - scalaVersion := "2.13.12", + scalaVersion := "2.13.13", compileOrder := CompileOrder.Mixed, githubWorkflowTargetTags ++= Seq("v*"), diff --git a/redis/src/main/scala/com/avsystem/commons/redis/commands/geo.scala b/redis/src/main/scala/com/avsystem/commons/redis/commands/geo.scala index 8c7fed75c..15a2676be 100644 --- a/redis/src/main/scala/com/avsystem/commons/redis/commands/geo.scala +++ b/redis/src/main/scala/com/avsystem/commons/redis/commands/geo.scala @@ -13,11 +13,11 @@ import scala.collection.mutable.ListBuffer trait GeoApi extends ApiSubset { /** Executes [[http://redis.io/commands/geoadd GEOADD]] */ def geoadd(key: Key, member: Value, point: GeoPoint): Result[Boolean] = - execute(new Geoadd(key, Opt.Empty, false, (member, point).single).map(_ > 0)) + execute(new Geoadd(key, Opt.Empty, changed = false, (member, point).single).map(_ > 0)) /** Executes [[http://redis.io/commands/geoadd GEOADD]] */ def geoadd(key: Key, item: (Value, GeoPoint), items: (Value, GeoPoint)*): Result[Int] = - execute(new Geoadd(key, Opt.Empty, false, item +:: items)) + execute(new Geoadd(key, Opt.Empty, changed = false, item +:: items)) /** Executes [[http://redis.io/commands/geoadd GEOADD]] * or simply returns 0 when `items` is empty, without sending the command to Redis */