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 33b6327b feat: Add -Yfuture-lazy-vals for Scala 3.3.x builds (#522)
33b6327b is described below

commit 33b6327b9035668b62c700754f023443618cbd90
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Sun Jun 14 19:16:07 2026 +0800

    feat: Add -Yfuture-lazy-vals for Scala 3.3.x builds (#522)
    
    Motivation:
    The Scala 3.3.8 compiler introduced the -Yfuture-lazy-vals flag to
    optionally use VarHandle instead of sun.misc.Unsafe for lazy val
    implementation. This prepares libraries for upcoming JDK releases
    that restrict sun.misc.Unsafe access.
    
    Modification:
    Add -Yfuture-lazy-vals to scalacOptions, conditionally applied only
    for Scala 3.3.x via CrossVersion.partialVersion or scalaBinaryVersion.
    
    Result:
    Scala 3.3.x build uses the future-proof VarHandle-based lazy val
    implementation, compatible with all JDK 9+ versions including future
    releases that restrict sun.misc.Unsafe.
    
    References:
    Refs scala/scala3-lts#637
    Refs apache/pekko#3059
---
 project/ProjectAutoPlugin.scala | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/project/ProjectAutoPlugin.scala b/project/ProjectAutoPlugin.scala
index f81cf5fb..dc530b9f 100644
--- a/project/ProjectAutoPlugin.scala
+++ b/project/ProjectAutoPlugin.scala
@@ -54,6 +54,8 @@ object ProjectAutoPlugin extends AutoPlugin {
       (CrossVersion.partialVersion(scalaVersion.value) match {
         case Some((2, _)) =>
           disciplineScalacOptions
+        case Some((3, _)) =>
+          Set("-Yfuture-lazy-vals")
         case _ =>
           Nil
       }).toSeq,


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

Reply via email to