Skip to content

Commit 11e6d7e

Browse files
committed
update Scala version to 2.13.17 and adjust the codebase
1 parent 7d60159 commit 11e6d7e

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
matrix:
2525
os: [ubuntu-latest]
26-
scala: [2.13.16]
26+
scala: [2.13.17]
2727
java: [temurin@17, temurin@21]
2828
runs-on: ${{ matrix.os }}
2929
steps:
@@ -75,7 +75,7 @@ jobs:
7575
strategy:
7676
matrix:
7777
os: [ubuntu-latest]
78-
scala: [2.13.16]
78+
scala: [2.13.17]
7979
java: [temurin@17]
8080
runs-on: ${{ matrix.os }}
8181
steps:

macros/src/main/scala/com/avsystem/commons/macros/MacroCommons.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ trait MacroCommons extends CompatMacroCommons { bundle =>
283283
.collectFirst {
284284
case (param, arg) if param.name == subSym.name => arg match {
285285
case Literal(Constant(value: T)) => value
286+
case Literal(Constant(null)) => whenDefault
286287
case t if param.asTerm.isParamWithDefault && t.symbol.isSynthetic &&
287288
t.symbol.name.decodedName.toString.contains("$default$") => whenDefault
288289
case t if classTag[T] == classTag[Tree] => t.asInstanceOf[T]
@@ -1394,7 +1395,7 @@ trait MacroCommons extends CompatMacroCommons { bundle =>
13941395
// while typechecking case body and not after that. Therefore we need a macro which will inject itself exactly
13951396
// into that moment.
13961397
val fakeMatch =
1397-
q"""
1398+
q"""
13981399
import scala.language.experimental.macros
13991400
def $normName(tpref: $StringCls, value: $ScalaPkg.Any): $ScalaPkg.Any =
14001401
macro $CommonsPkg.macros.misc.WhiteMiscMacros.normalizeGadtSubtype

mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/TypedMongoClient.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ class TypedMongoClient(
5757
def listDatabaseNames: Observable[String] =
5858
multi(optionalizeFirstArg(nativeClient.listDatabaseNames(sessionOrNull)))
5959

60-
def listDatabases: Observable[Document] =
60+
@deprecated("Use listTypedDatabases or listRawDatabases instead", "2.25.0")
61+
def listDatabases: Observable[Nothing] = ???
62+
63+
def listRawDatabases: Observable[Document] =
6164
multi(optionalizeFirstArg(nativeClient.listDatabases(sessionOrNull)))
6265

63-
def listDatabases[T: GenCodec]: Observable[T] =
64-
listDatabases.map(doc => BsonValueInput.read[T](doc.toBsonDocument))
66+
def listTypedDatabases[T: GenCodec]: Observable[T] =
67+
listRawDatabases.map(doc => BsonValueInput.read[T](doc.toBsonDocument))
6568

6669
//TODO: `watch` methods
6770

mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/TypedMongoDatabase.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ class TypedMongoDatabase(
4747
def listCollectionNames: Observable[String] =
4848
multi(optionalizeFirstArg(nativeDatabase.listCollectionNames(sessionOrNull)))
4949

50-
def listCollections: Observable[Document] =
50+
@deprecated("Use listTypedCollections or listRawCollections instead", "2.25.0")
51+
def listDatabases: Observable[Nothing] = ???
52+
53+
def listRawCollections: Observable[Document] =
5154
multi(optionalizeFirstArg(nativeDatabase.listCollections(sessionOrNull)))
5255

53-
def listCollections[T: GenCodec]: Observable[T] =
54-
listCollections.map(doc => BsonValueInput.read[T](doc.toBsonDocument))
56+
def listTypedCollections[T: GenCodec]: Observable[T] =
57+
listRawCollections.map(doc => BsonValueInput.read[T](doc.toBsonDocument))
5558

5659
def createCollection(
5760
name: String,

project/Commons.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ object Commons extends ProjectGroup("commons") {
6565
Developer("ddworak", "Dawid Dworak", "[email protected]", url("https://github.com/ddworak")),
6666
),
6767

68-
scalaVersion := "2.13.16",
68+
scalaVersion := "2.13.17",
6969
compileOrder := CompileOrder.Mixed,
7070

7171
githubWorkflowTargetTags ++= Seq("v*"),

redis/src/main/scala/com/avsystem/commons/redis/commands/ReplyDecoders.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ object ReplyDecoders {
303303
}
304304

305305
val multiBulkAsXConsumerInfo: ReplyDecoder[XConsumerInfo] =
306-
flatMultiBulkAsMap(bulkAsUTF8, undecoded).andThen(XConsumerInfo.apply)
306+
flatMultiBulkAsMap(bulkAsUTF8, undecoded).andThen(XConsumerInfo.apply _)
307307

308308
val multiBulkAsXGroupInfo: ReplyDecoder[XGroupInfo] =
309-
flatMultiBulkAsMap(bulkAsUTF8, undecoded).andThen(XGroupInfo.apply)
309+
flatMultiBulkAsMap(bulkAsUTF8, undecoded).andThen(XGroupInfo.apply _)
310310

311311
def multiBulkAsXStreamInfoOf[Rec: RedisRecordCodec]: ReplyDecoder[XStreamInfo[Rec]] =
312312
flatMultiBulkAsMap(bulkAsUTF8, undecoded).andThen(XStreamInfo[Rec](_))
@@ -374,7 +374,7 @@ object ReplyDecoders {
374374
flatMultiBulkAsMap(bulkAs[A], bulkAs[B])
375375

376376
def flatMultiBulkAsRecord[R: RedisRecordCodec]: ReplyDecoder[R] = {
377-
case ArrayMsg(elements: IndexedSeq[BulkStringMsg@unchecked]) if elements.forall(_.isInstanceOf[BulkStringMsg]) =>
377+
case ArrayMsg(elements: IndexedSeq[BulkStringMsg @unchecked]) if elements.forall(_.isInstanceOf[BulkStringMsg]) =>
378378
RedisRecordCodec[R].read(elements)
379379
}
380380

0 commit comments

Comments
 (0)