From 35e9260e0a0e12fe62e19b56c59b76b855566edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kozak?= Date: Mon, 1 Jun 2026 23:40:11 +0200 Subject: [PATCH 1/2] refactor(scala-3): convert varargs splice : _* to * Scala 3 stdlib deprecates Scala 2 `foo(seq: _*)` syntax in favor of bare `foo(seq*)`. Pure call-site syntax change with no source-compat impact for callers of unchanged signatures. - core/js,jvm CrossUtils: wrappedArray, dictionary call sites - core jiop JCollectionUtils.JIterable.apply - mongo MongoOrder.apply - atLeast.scala scaladoc updated to current syntax --- .../src/main/scala/com/avsystem/commons/misc/CrossUtils.scala | 4 ++-- .../src/main/scala/com/avsystem/commons/misc/CrossUtils.scala | 4 ++-- .../main/scala/com/avsystem/commons/annotation/atLeast.scala | 4 ++-- .../scala/com/avsystem/commons/jiop/JCollectionUtils.scala | 2 +- .../scala/com/avsystem/commons/mongo/typed/MongoOrder.scala | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/js/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala b/core/js/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala index 30d609047..b34506059 100644 --- a/core/js/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala +++ b/core/js/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala @@ -19,7 +19,7 @@ object CrossUtils { def newNativeDict[A]: NativeDict[A] = js.Dictionary.empty[A] - def wrappedArray[A](elems: A*): MIndexedSeq[A] = js.Array(elems: _*) + def wrappedArray[A](elems: A*): MIndexedSeq[A] = js.Array(elems*) def arrayBuffer[A]: MIndexedSeq[A] with MBuffer[A] = js.Array[A]() - def dictionary[A](keyValues: (String, A)*): MMap[String, A] = js.Dictionary(keyValues: _*) + def dictionary[A](keyValues: (String, A)*): MMap[String, A] = js.Dictionary(keyValues*) } diff --git a/core/jvm/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala b/core/jvm/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala index 2d5129021..b040e6068 100644 --- a/core/jvm/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala +++ b/core/jvm/src/main/scala/com/avsystem/commons/misc/CrossUtils.scala @@ -9,7 +9,7 @@ object CrossUtils { def newNativeDict[A]: NativeDict[A] = new MHashMap[String, A] def unsetArrayValue: Any = null - def wrappedArray[A: ClassTag](elems: A*): MIndexedSeq[A] = Array(elems: _*) + def wrappedArray[A: ClassTag](elems: A*): MIndexedSeq[A] = Array(elems*) def arrayBuffer[A]: MIndexedSeq[A] with MBuffer[A] = new MArrayBuffer[A] - def dictionary[A](keyValues: (String, A)*): MMap[String, A] = MHashMap[String, A](keyValues: _*) + def dictionary[A](keyValues: (String, A)*): MMap[String, A] = MHashMap[String, A](keyValues*) } diff --git a/core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala b/core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala index 29ef6591d..b43246868 100644 --- a/core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala +++ b/core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala @@ -4,9 +4,9 @@ package annotation /** When applied on varargs parameter, indicates that at least some number of parameters is required. This is later * checked by the static analyzer.
WARNING: implementation of method which takes a varargs parameter may NOT * assume that given number of arguments will always be passed, because it's still possible to pass a `Seq` where - * varargs parameter is required using the `: _*` ascription, e.g. + * varargs parameter is required using the `*` ascription, e.g. * {{{ - * varargsMethod(List(): _*) + * varargsMethod(List()*) * }}} * and that is not checked by the static analyzer. */ diff --git a/core/src/main/scala/com/avsystem/commons/jiop/JCollectionUtils.scala b/core/src/main/scala/com/avsystem/commons/jiop/JCollectionUtils.scala index 381b5e167..4fb9bf563 100644 --- a/core/src/main/scala/com/avsystem/commons/jiop/JCollectionUtils.scala +++ b/core/src/main/scala/com/avsystem/commons/jiop/JCollectionUtils.scala @@ -73,7 +73,7 @@ trait JCollectionUtils extends JFactories { object JIterable { def apply[T](values: T*): JIterable[T] = - JArrayList(values: _*) + JArrayList(values*) implicit def asJIterableFactory[T](obj: JIterable.type): Factory[T, JIterable[T]] = new JCollectionFactory(new JArrayList) diff --git a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala index c43883f71..aa48e0081 100644 --- a/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala +++ b/mongo/jvm/src/main/scala/com/avsystem/commons/mongo/typed/MongoOrder.scala @@ -22,7 +22,7 @@ object MongoOrder { def simple[T](ascending: Boolean): MongoOrder[T] = Simple(ascending) def apply[E](refs: (MongoPropertyRef[E, _], Boolean)*): MongoDocumentOrder[E] = - MongoDocumentOrder(refs: _*) + MongoDocumentOrder(refs*) final case class Simple[T](ascending: Boolean) extends MongoOrder[T] { def toBson: BsonValue = Bson.int(if (ascending) 1 else -1) From eec02263bb67206e2464db5a1298efc0270d1c5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Kozak?= Date: Mon, 1 Jun 2026 23:40:28 +0200 Subject: [PATCH 2/2] docs(migration): record varargs splice syntax change Slice 3.7: scala-2 `: _*` -> scala-3 `*` call-site syntax. --- MIGRATION.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index b99395701..0b216c7c2 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -54,6 +54,9 @@ the bottom of this file. Restoration ships incrementally per feature area. compiles). - `enum` was renamed to `e` at one call site in `GenKeyCodec` (`enum` is reserved in Scala 3). - `@targetName` annotation added to `CloseableIterator` overloaded methods. +- Varargs splice syntax modernized from Scala 2 `foo(seq: _*)` to Scala 3 `foo(seq*)` across all + call sites (`CrossUtils.wrappedArray`/`dictionary`, `JCollectionUtils.JIterable.apply`, + `MongoOrder.apply`). Pure call-site syntax — no signature change, no source-compat impact. ### mongo