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-cassandra.git
The following commit(s) were added to refs/heads/main by this push:
new aff6975 fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#429)
aff6975 is described below
commit aff6975508039607c0d2263893573eef3f777c78
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:25:44 2026 +0800
fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#429)
* fix: make -Yfuture-lazy-vals conditional for Scala 3.9+
Motivation:
Scala 3.9 removed the -Yfuture-lazy-vals compiler option as the behavior
is now the default. Passing this flag causes compilation errors on Scala
3.9+.
Modification:
Conditionally add -Yfuture-lazy-vals only when Scala minor version < 9
using CrossVersion.partialVersion check.
Result:
Project compiles on both Scala 3.3.x (which needs the flag) and
Scala 3.9+ (which has the behavior by default).
* chore: apply scalafmt to project/Common.scala
Motivation:
CI scalafmt check failed because project/Common.scala was not formatted.
Modification:
Ran scalafmt on the build file.
Result:
Code is formatted CI check should pass.
Tests:
Not run - formatting only
---
project/Common.scala | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/project/Common.scala b/project/Common.scala
index 82c87a7..2b71070 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -48,7 +48,6 @@ object Common extends AutoPlugin {
scalacOptions ++= {
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",
@@ -56,9 +55,11 @@ object Common extends AutoPlugin {
"-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",
"-Wconf:msg=bad option.*-Xlint:s",
- "-Wconf:msg=bad option.*-Ywarn-dead-code:s")
+ "-Wconf:msg=bad option.*-Ywarn-dead-code:s") ++
+ (if (CrossVersion.partialVersion(scalaVersion.value).exists(_._2 < 9))
+ Seq("-Yfuture-lazy-vals", "-Wconf:msg=bad
option.*-Yfuture-lazy-vals:s")
+ else Seq.empty)
else Seq("-Xlint", "-Ywarn-dead-code")
},
Compile / console / scalacOptions --= Seq("-deprecation",
"-Xfatal-warnings", "-Xlint", "-Ywarn-unused:imports"),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]