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 update #445

Merged
merged 1 commit into from
Jun 19, 2023
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
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")
ddworak marked this conversation as resolved.
Show resolved Hide resolved

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