This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-persistence-r2dbc.git
The following commit(s) were added to refs/heads/main by this push:
new 9d7cbb5 feat: improve Scala 3.8 forward compatibility (#405)
9d7cbb5 is described below
commit 9d7cbb5d36c04c8881dec90c6d00a2226a662b0e
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Mon Jun 15 02:02:49 2026 +0800
feat: improve Scala 3.8 forward compatibility (#405)
Motivation:
Scala 3.8 introduces new warnings and deprecations that will become
errors in future versions. Preparing the codebase for smooth upgrades.
Modification:
- Replace `= _` with `= null` in ContinuousQuery.scala (deprecated in 3.8)
- Add -Wconf suppressions for warnings requiring Scala 3-only syntax
(using clauses, wildcard types, eta-expansion, with operator, etc.)
Result:
Zero new warnings when compiled with Scala 3.8.4, while maintaining
full cross-compilation with Scala 2.13 and 3.3.x.
---
.../pekko/persistence/r2dbc/internal/ContinuousQuery.scala | 2 +-
project/CommonSettings.scala | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git
a/core/src/main/scala/org/apache/pekko/persistence/r2dbc/internal/ContinuousQuery.scala
b/core/src/main/scala/org/apache/pekko/persistence/r2dbc/internal/ContinuousQuery.scala
index a0b1ae4..de561e4 100644
---
a/core/src/main/scala/org/apache/pekko/persistence/r2dbc/internal/ContinuousQuery.scala
+++
b/core/src/main/scala/org/apache/pekko/persistence/r2dbc/internal/ContinuousQuery.scala
@@ -86,7 +86,7 @@ final private[r2dbc] class ContinuousQuery[S, T](
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic =
new TimerGraphStageLogicWithLogging(shape) with OutHandler {
var nextRow: OptionVal[T] = OptionVal.none[T]
- var sinkIn: SubSinkInlet[T] = _
+ var sinkIn: SubSinkInlet[T] = null
var state = initialState
var nrElements = Long.MaxValue
var subStreamFinished = false
diff --git a/project/CommonSettings.scala b/project/CommonSettings.scala
index d5e6d64..5722aea 100644
--- a/project/CommonSettings.scala
+++ b/project/CommonSettings.scala
@@ -27,7 +27,17 @@ object CommonSettings extends AutoPlugin {
// Setting javac options in common allows IntelliJ IDEA to import them
automatically
Compile / javacOptions ++= Seq("-encoding", "UTF-8", "--release", "17"),
scalacOptions ++= {
- if (scalaBinaryVersion.value == "3") Seq("-Yfuture-lazy-vals",
"-release:17")
+ if (scalaBinaryVersion.value == "3")
+ Seq(
+ "-Yfuture-lazy-vals",
+ "-release:17",
+ "-Wconf:msg=Implicit parameters should be provided with a `using`
clause:s",
+ "-Wconf:msg=is deprecated for wildcard arguments of types:s",
+ "-Wconf:msg=The trailing ` _` for eta-expansion is unnecessary:s",
+ "-Wconf:msg=with as a type operator has been deprecated:s",
+ "-Wconf:msg=Unreachable case except for null:s",
+ "-Wconf:msg=is no longer supported for vararg splices:s",
+ "-Wconf:msg=bad option.*-Yfuture-lazy-vals:s")
else Seq.empty
},
Test / logBuffered := false,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]