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.git


The following commit(s) were added to refs/heads/main by this push:
     new 8b4929235 fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ 
(#1691)
8b4929235 is described below

commit 8b4929235dc05346059fb9af9d7e14b910b95a80
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:26:09 2026 +0800

    fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#1691)
    
    * 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:
    scalafmtSbtCheck and Code is formatted CI checks 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 d3adda42a..058c44562 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -65,7 +65,6 @@ object Common extends AutoPlugin {
       "-release:17"),
     scalacOptions ++= {
       if (isScala3.value) Seq(
-        "-Yfuture-lazy-vals",
         "-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",
@@ -76,8 +75,10 @@ object Common extends AutoPlugin {
         "-Wconf:msg=auto insertion will be deprecated:s",
         "-Wconf:msg=Ignoring \\[this\\] qualifier:s",
         "-Wconf:msg=trait App in package scala is deprecated:s",
-        "-Wconf:msg=pattern binding uses refutable extractor:s",
-        "-Wconf:msg=bad option.*-Yfuture-lazy-vals:s")
+        "-Wconf:msg=pattern binding uses refutable extractor: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",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to