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-connectors-kafka.git
The following commit(s) were added to refs/heads/main by this push:
new 099c6ffd fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#559)
099c6ffd is described below
commit 099c6ffd41a6f671019ec5b32e0378819bf96772
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:26:45 2026 +0800
fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#559)
* 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/ProjectSettings.scala
Motivation:
CI scalafmt check failed because project/ProjectSettings.scala was not
formatted.
Modification:
Ran scalafmt on the build file.
Result:
scalafmtSbtCheck and Code is formatted CI checks should pass.
Tests:
Not run - formatting only
---
project/ProjectSettings.scala | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/project/ProjectSettings.scala b/project/ProjectSettings.scala
index 32b7b34a..1f4d9fc9 100644
--- a/project/ProjectSettings.scala
+++ b/project/ProjectSettings.scala
@@ -96,7 +96,6 @@ object ProjectSettings 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",
@@ -106,8 +105,10 @@ object ProjectSettings extends AutoPlugin {
"-Wconf:msg=is no longer supported for vararg splices:s",
"-Wconf:msg=is not declared infix:s",
"-Wconf:msg=auto insertion will be deprecated:s",
- "-Wconf:msg=Invalid message filter:s",
- "-Wconf:msg=bad option.*-Yfuture-lazy-vals:s")
+ "-Wconf:msg=Invalid message filter: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.empty
},
Compile / doc / scalacOptions := scalacOptions.value ++ Seq(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]