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 5cb1a64  fix: make -Yfuture-lazy-vals conditional for Scala 3.9+ (#413)
5cb1a64 is described below

commit 5cb1a649f48575e1b01b49eb5826da47d9e1eb50
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:23:31 2026 +0800

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

diff --git a/project/CommonSettings.scala b/project/CommonSettings.scala
index 003b5c8..850b84e 100644
--- a/project/CommonSettings.scala
+++ b/project/CommonSettings.scala
@@ -34,15 +34,16 @@ object CommonSettings extends AutoPlugin {
         "-language:existentials")
       if (scalaBinaryVersion.value == "3")
         commonWconf ++ 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")
+          "-Wconf:msg=is no longer supported for vararg splices: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 commonWconf
     },
     Test / logBuffered := false,


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

Reply via email to