Skip to content

Commit

Permalink
Merge pull request #445 from AVSystem/scala-update
Browse files Browse the repository at this point in the history
Scala update
  • Loading branch information
ddworak authored Jun 19, 2023
2 parents 5043023 + 9f440b4 commit 4c24627
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 21 deletions.
16 changes: 8 additions & 8 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.10, 2.12.17]
scala: [2.13.11, 2.12.18]
java: [temurin@11, temurin@17]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.avsystem.commons
package derivation

trait DeferredInstance[T] {this: T =>
trait DeferredInstance[T] { this: T =>
var underlying: T = _
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package com.avsystem.commons.hocon
package com.avsystem.commons
package hocon

import com.avsystem.commons.testutil.FileBasedSuite

Expand Down
10 changes: 5 additions & 5 deletions mongo/jvm/src/main/scala/com/avsystem/commons/mongo/Filter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
}
}
2 changes: 1 addition & 1 deletion project/Commons.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object Commons extends ProjectGroup("commons") {
Developer("ghik", "Roman Janusz", "[email protected]", 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,

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

0 comments on commit 4c24627

Please sign in to comment.