Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 2.13.13 #548

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion project/Commons.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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*"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading