From 9f440b4313add987908df587e9e5e97b3b4a4bb3 Mon Sep 17 00:00:00 2001 From: Sebastian Haracz Date: Fri, 16 Jun 2023 23:10:54 +0200 Subject: [PATCH] Scala 2.13.11, 2.11.18 --- .github/workflows/ci.yml | 16 ++++++++-------- .../commons/derivation/DeferredInstance.scala | 2 +- .../commons/misc/SharedExtensionsTest.scala | 9 +++++++-- .../commons/serialization/BuildablePojo.scala | 2 -- .../com/avsystem/commons/hocon/HParserTest.scala | 3 ++- .../com/avsystem/commons/mongo/Filter.scala | 10 +++++----- project/Commons.scala | 2 +- .../redis/examples/ScriptingExample.scala | 2 +- 8 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbef687de..62d8730b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.10, 2.12.17] + scala: [2.13.11, 2.12.18] java: [temurin@11, temurin@17] runs-on: ${{ matrix.os }} steps: @@ -101,7 +101,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.10] + scala: [2.13.11] java: [temurin@11] runs-on: ${{ matrix.os }} steps: @@ -136,22 +136,22 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.13.10) + - name: Download target directories (2.13.11) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.13.10-${{ matrix.java }} + name: target-${{ matrix.os }}-2.13.11-${{ matrix.java }} - - name: Inflate target directories (2.13.10) + - name: Inflate target directories (2.13.11) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.12.17) + - name: Download target directories (2.12.18) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.17-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }} - - name: Inflate target directories (2.12.17) + - name: Inflate target directories (2.12.18) run: | tar xf targets.tar rm targets.tar diff --git a/core/src/main/scala/com/avsystem/commons/derivation/DeferredInstance.scala b/core/src/main/scala/com/avsystem/commons/derivation/DeferredInstance.scala index 45d0d40d6..18ad6c100 100644 --- a/core/src/main/scala/com/avsystem/commons/derivation/DeferredInstance.scala +++ b/core/src/main/scala/com/avsystem/commons/derivation/DeferredInstance.scala @@ -1,6 +1,6 @@ package com.avsystem.commons package derivation -trait DeferredInstance[T] {this: T => +trait DeferredInstance[T] { this: T => var underlying: T = _ } diff --git a/core/src/test/scala/com/avsystem/commons/misc/SharedExtensionsTest.scala b/core/src/test/scala/com/avsystem/commons/misc/SharedExtensionsTest.scala index e1ce645a8..63cb555ec 100644 --- a/core/src/test/scala/com/avsystem/commons/misc/SharedExtensionsTest.scala +++ b/core/src/test/scala/com/avsystem/commons/misc/SharedExtensionsTest.scala @@ -154,7 +154,12 @@ class SharedExtensionsTest extends AnyFunSuite with Matchers { } test("sourceCode") { - assert(123.sourceCode == "123") + // for some magical reason does not work on 'Int' type in Scala 2.13.11: + // java.lang.NullPointerException: Cannot invoke "scala.reflect.internal.Symbols$Symbol.owner()" because the return value of "scala.reflect.internal.Trees$Tree.symbol()" is null + // scala.tools.nsc.typechecker.Typers$Typer.checkDubiousAdaptation$1(Typers.scala:5330) + // assert(123.sourceCode == "123") + + assert(123.123.sourceCode == "123.123") val src = { println(123) @@ -169,7 +174,7 @@ class SharedExtensionsTest extends AnyFunSuite with Matchers { } test("withSourceCode") { - assert(123.withSourceCode == (123, "123")) + assert(123.123.withSourceCode == (123.123, "123.123")) } test("flatCollect") { diff --git a/core/src/test/scala/com/avsystem/commons/serialization/BuildablePojo.scala b/core/src/test/scala/com/avsystem/commons/serialization/BuildablePojo.scala index aad8a1f20..76b00f34e 100644 --- a/core/src/test/scala/com/avsystem/commons/serialization/BuildablePojo.scala +++ b/core/src/test/scala/com/avsystem/commons/serialization/BuildablePojo.scala @@ -1,8 +1,6 @@ package com.avsystem.commons package serialization -import java.util.Objects - // this should be written in Java but it was rewritten to Scala in order to make Scala.js linker happy object BuildablePojo { def builder(): Builder = new Builder diff --git a/hocon/src/test/scala/com/avsystem/commons/hocon/HParserTest.scala b/hocon/src/test/scala/com/avsystem/commons/hocon/HParserTest.scala index 8f9697fbd..f8fb42515 100644 --- a/hocon/src/test/scala/com/avsystem/commons/hocon/HParserTest.scala +++ b/hocon/src/test/scala/com/avsystem/commons/hocon/HParserTest.scala @@ -1,4 +1,5 @@ -package com.avsystem.commons.hocon +package com.avsystem.commons +package hocon import com.avsystem.commons.testutil.FileBasedSuite diff --git a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/Filter.scala b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/Filter.scala index c9f05d7f0..0c610cb17 100644 --- a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/Filter.scala +++ b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/Filter.scala @@ -54,10 +54,10 @@ object Filter { trait CanCompare[BSON <: BsonValue] object CanCompare { def create[BSON <: BsonValue]: CanCompare[BSON] = new CanCompare[BSON] {} - implicit val date = create[BsonDateTime] - implicit val int32 = create[BsonInt32] - implicit val int64 = create[BsonInt64] - implicit val double = create[BsonDouble] + implicit val date: CanCompare[BsonDateTime] = create[BsonDateTime] + implicit val int32: CanCompare[BsonInt32] = create[BsonInt32] + implicit val int64: CanCompare[BsonInt64] = create[BsonInt64] + implicit val double: CanCompare[BsonDouble] = create[BsonDouble] } } -} \ No newline at end of file +} diff --git a/project/Commons.scala b/project/Commons.scala index b60a00be8..4c60b5b52 100644 --- a/project/Commons.scala +++ b/project/Commons.scala @@ -71,7 +71,7 @@ object Commons extends ProjectGroup("commons") { Developer("ghik", "Roman Janusz", "r.janusz@avsystem.com", url("https://github.com/ghik")), ), - crossScalaVersions := Seq("2.13.10", "2.12.17"), + crossScalaVersions := Seq("2.13.11", "2.12.18"), scalaVersion := crossScalaVersions.value.head, compileOrder := CompileOrder.Mixed, diff --git a/redis/src/test/scala/com/avsystem/commons/redis/examples/ScriptingExample.scala b/redis/src/test/scala/com/avsystem/commons/redis/examples/ScriptingExample.scala index a01a81e7f..aa2f098ff 100644 --- a/redis/src/test/scala/com/avsystem/commons/redis/examples/ScriptingExample.scala +++ b/redis/src/test/scala/com/avsystem/commons/redis/examples/ScriptingExample.scala @@ -11,7 +11,7 @@ import com.avsystem.commons.redis.protocol.{BulkStringMsg, NullBulkStringMsg} * Example which shows how to execute LUA scripts. */ object ScriptingExample extends App { - implicit val actorSystem = ActorSystem() + implicit val actorSystem: ActorSystem = ActorSystem() val client = new RedisNodeClient val api = RedisApi.Node.Async.StringTyped(client)