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


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

commit 0376eb53680ba667a047ea001c8d47f1ae9a87d1
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:25:15 2026 +0800

    fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#535)
    
    * 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/ProjectAutoPlugin.scala
    
    Motivation:
    CI scalafmt check failed because project/ProjectAutoPlugin.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/ProjectAutoPlugin.scala | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/project/ProjectAutoPlugin.scala b/project/ProjectAutoPlugin.scala
index 0a4fd2a0..67cac780 100644
--- a/project/ProjectAutoPlugin.scala
+++ b/project/ProjectAutoPlugin.scala
@@ -55,13 +55,14 @@ object ProjectAutoPlugin extends AutoPlugin {
           disciplineScalacOptions ++ Set("-Xlog-reflective-calls")
         case Some((3, _)) =>
           Set(
-            "-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",
             "-Wconf:msg=with as a type operator has been deprecated:s",
-            "-Wconf:msg=Unreachable case except for null:s",
-            "-Wconf:msg=bad option.*-Yfuture-lazy-vals:s")
+            "-Wconf:msg=Unreachable case except for null:s") ++
+          (if (CrossVersion.partialVersion(scalaVersion.value).exists(_._2 < 
9))
+             Seq("-Yfuture-lazy-vals", "-Wconf:msg=bad 
option.*-Yfuture-lazy-vals:s")
+           else Seq.empty)
         case _ =>
           Nil
       }).toSeq,


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

Reply via email to