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-management.git
The following commit(s) were added to refs/heads/main by this push:
new d9698abd fix: Scala 3.9 context bound compat for SortedSet.empty (#839)
d9698abd is described below
commit d9698abd18d76c1ae3b8e9ead28a39fbd9baa8ba
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 19 01:25:56 2026 +0800
fix: Scala 3.9 context bound compat for SortedSet.empty (#839)
* fix: Scala 3.9 context bound compat for SortedSet.empty
Motivation:
Scala 3.9.0-RC1 changes context bound desugaring, making explicit
`SortedSet.empty(Member.ageOrdering)` fail with a type mismatch error.
Modification:
Use implicit val for the Ordering instead of passing it explicitly
to SortedSet.empty.
Result:
rolling-update-kubernetes module compiles cleanly with Scala 3.9.0-RC1.
Tests:
- sbt "++3.9.0-RC1!; rolling-update-kubernetes/compile;
rolling-update-kubernetes/Test/compile" passes
References: None - Scala 3.9 forward compatibility
* 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).
* fix: fix operator mixing compilation error and make implicit private
Motivation:
CI failed because project/Common.scala mixed left- and right-associative
operators (++: with ++) which Scala 3.9 disallows. Also address reviewer
feedback to make implicit ordering private.
Modification:
- Wrap ++ expression in parentheses to resolve operator precedence conflict
- Change implicit val memberAgeOrdering to private implicit val per review
Result:
sbt can load successfully and PodDeletionCostAnnotator implicit is scoped.
Tests:
Not run - build definition fix and review feedback
---
project/Common.scala | 10 ++++++----
.../rollingupdate/kubernetes/PodDeletionCostAnnotator.scala | 3 ++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/project/Common.scala b/project/Common.scala
index 1187419e..e29aa409 100644
--- a/project/Common.scala
+++ b/project/Common.scala
@@ -57,16 +57,18 @@ object Common extends AutoPlugin {
"-Werror",
"-Wdead-code")
else
- scalacOptionsBase ++: Seq(
+ scalacOptionsBase ++:
+ (Seq(
"-Werror",
- "-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=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))
},
javacOptions ++= Seq(
"-Xlint:unchecked"),
diff --git
a/rolling-update-kubernetes/src/main/scala/org/apache/pekko/rollingupdate/kubernetes/PodDeletionCostAnnotator.scala
b/rolling-update-kubernetes/src/main/scala/org/apache/pekko/rollingupdate/kubernetes/PodDeletionCostAnnotator.scala
index 70b36825..f57a9ff3 100644
---
a/rolling-update-kubernetes/src/main/scala/org/apache/pekko/rollingupdate/kubernetes/PodDeletionCostAnnotator.scala
+++
b/rolling-update-kubernetes/src/main/scala/org/apache/pekko/rollingupdate/kubernetes/PodDeletionCostAnnotator.scala
@@ -67,7 +67,8 @@ import com.typesafe.config.Config
Cluster(context.system).subscribe(context.self,
classOf[ClusterEvent.MemberUp], classOf[ClusterEvent.MemberRemoved])
- def receive: Receive = idle(0, SortedSet.empty(Member.ageOrdering), 0)
+ private implicit val memberAgeOrdering: Ordering[Member] = Member.ageOrdering
+ def receive: Receive = idle(0, SortedSet.empty, 0)
private def idle(deletionCost: Int, membersByAgeDesc: SortedSet[Member],
retryNr: Int): Receive = {
case cs @ ClusterEvent.CurrentClusterState(members, _, _, _, _) =>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]