Skip to content

Commit e399c43

Browse files
Migrate varargs syntax from : _* to * in dotty project (#18822)
2 parents 80eb6e1 + 6812835 commit e399c43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+123
-118
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1825,7 +1825,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
18251825
else
18261826
jliLambdaMetaFactoryMetafactoryHandle
18271827

1828-
bc.jmethod.visitInvokeDynamicInsn(methodName, desc, metafactory, bsmArgs: _*)
1828+
bc.jmethod.visitInvokeDynamicInsn(methodName, desc, metafactory, bsmArgs*)
18291829

18301830
generatedType
18311831
}

compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ trait BCodeIdiomatic {
247247
): Unit = {
248248
jmethod.visitInvokeDynamicInsn(
249249
"makeConcatWithConstants",
250-
asm.Type.getMethodDescriptor(StringRef.toASMType, argTypes:_*),
250+
asm.Type.getMethodDescriptor(StringRef.toASMType, argTypes*),
251251
coreBTypes.jliStringConcatFactoryMakeConcatWithConstantsHandle,
252-
(recipe +: constants):_*
252+
(recipe +: constants)*
253253
)
254254
}
255255

@@ -522,7 +522,7 @@ trait BCodeIdiomatic {
522522
i += 1
523523
}
524524
assert(oldPos == keys.length, "emitSWITCH")
525-
jmethod.visitTableSwitchInsn(keyMin, keyMax, defaultBranch, newBranches: _*)
525+
jmethod.visitTableSwitchInsn(keyMin, keyMax, defaultBranch, newBranches*)
526526
} else {
527527
jmethod.visitLookupSwitchInsn(defaultBranch, keys, branches)
528528
}

compiler/src/dotty/tools/backend/jvm/BackendUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class BackendUtils(val postProcessor: PostProcessor) {
107107
val mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "$deserializeLambda$", serializedLamdaObjDesc, null, null)
108108
def emitLambdaDeserializeIndy(targetMethods: Seq[Handle]): Unit = {
109109
mv.visitVarInsn(ALOAD, 0)
110-
mv.visitInvokeDynamicInsn("lambdaDeserialize", serializedLamdaObjDesc, jliLambdaDeserializeBootstrapHandle, targetMethods: _*)
110+
mv.visitInvokeDynamicInsn("lambdaDeserialize", serializedLamdaObjDesc, jliLambdaDeserializeBootstrapHandle, targetMethods*)
111111
}
112112

113113
val targetMethodGroupLimit = 255 - 1 - 3 // JVM limit. See See MAX_MH_ARITY in CallSite.java

compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
201201
val parent = filePath.getParent
202202
if (!builtPaths.containsKey(parent)) {
203203
parent.iterator.forEachRemaining(checkName)
204-
try Files.createDirectories(parent, noAttributes: _*)
204+
try Files.createDirectories(parent, noAttributes*)
205205
catch {
206206
case e: FileAlreadyExistsException =>
207207
// `createDirectories` reports this exception if `parent` is an existing symlink to a directory

compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ abstract class CoreBTypesFromSymbols[I <: DottyBackendInterface] extends CoreBTy
233233
(List(LARRAY_LENGTH, LARRAY_GET, LARRAY_SET) map (_ -> LONG)) ++
234234
(List(FARRAY_LENGTH, FARRAY_GET, FARRAY_SET) map (_ -> FLOAT)) ++
235235
(List(DARRAY_LENGTH, DARRAY_GET, DARRAY_SET) map (_ -> DOUBLE)) ++
236-
(List(OARRAY_LENGTH, OARRAY_GET, OARRAY_SET) map (_ -> ObjectRef)) : _*
236+
(List(OARRAY_LENGTH, OARRAY_GET, OARRAY_SET) map (_ -> ObjectRef)) *
237237
)
238238
}
239239
}

compiler/src/dotty/tools/dotc/classpath/AggregateClassPath.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ case class AggregateClassPath(aggregates: Seq[ClassPath]) extends ClassPath {
5656

5757
override def asClassPathStrings: Seq[String] = aggregates.map(_.asClassPathString).distinct
5858

59-
override def asSourcePathString: String = ClassPath.join(aggregates map (_.asSourcePathString): _*)
59+
override def asSourcePathString: String = ClassPath.join(aggregates map (_.asSourcePathString)*)
6060

6161
override private[dotty] def packages(inPackage: PackageName): Seq[PackageEntry] = {
6262
val aggregatedPackages = aggregates.flatMap(_.packages(inPackage)).distinct

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ object Feature:
2626
val dependent = experimental("dependent")
2727
val erasedDefinitions = experimental("erasedDefinitions")
2828
val symbolLiterals = deprecated("symbolLiterals")
29+
val ascriptionVarargsUnpacking = deprecated("ascriptionVarargsUnpacking")
2930
val fewerBraces = experimental("fewerBraces")
3031
val saferExceptions = experimental("saferExceptions")
3132
val clauseInterleaving = experimental("clauseInterleaving")

compiler/src/dotty/tools/dotc/config/Settings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object Settings:
2424
val OutputTag: ClassTag[AbstractFile] = ClassTag(classOf[AbstractFile])
2525

2626
class SettingsState(initialValues: Seq[Any]):
27-
private val values = ArrayBuffer(initialValues: _*)
27+
private val values = ArrayBuffer(initialValues*)
2828
private var _wasRead: Boolean = false
2929

3030
override def toString: String = s"SettingsState(values: ${values.toList})"

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ object Contexts {
414414
* from constructor parameters to class parameter accessors.
415415
*/
416416
def superCallContext: Context = {
417-
val locals = newScopeWith(owner.typeParams ++ owner.asClass.paramAccessors: _*)
417+
val locals = newScopeWith(owner.typeParams ++ owner.asClass.paramAccessors*)
418418
superOrThisCallContext(owner.primaryConstructor, locals)
419419
}
420420

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ object Flags {
188188
flag
189189
}
190190

191-
def commonFlags(flagss: FlagSet*): FlagSet = union(flagss.map(_.toCommonFlags): _*)
191+
def commonFlags(flagss: FlagSet*): FlagSet = union(flagss.map(_.toCommonFlags)*)
192192

193193
/** The empty flag set */
194194
val EmptyFlags: FlagSet = FlagSet(0)

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5956,7 +5956,7 @@ object Types {
59565956
val elems = scope.toList
59575957
val elems1 = mapOver(elems)
59585958
if (elems1 eq elems) scope
5959-
else newScopeWith(elems1: _*)
5959+
else newScopeWith(elems1*)
59605960
}
59615961

59625962
def mapOver(tree: Tree): Tree = treeTypeMap(tree)

compiler/src/dotty/tools/dotc/parsing/Tokens.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class TokensCommon {
1414
type Token = Int
1515
type TokenSet = BitSet
1616

17-
def tokenRange(lo: Int, hi: Int): TokenSet = BitSet(lo to hi: _*)
17+
def tokenRange(lo: Int, hi: Int): TokenSet = BitSet(lo to hi *)
1818

1919
val tokenString, debugString: Array[String] = new Array[String](maxToken + 1)
2020

compiler/src/dotty/tools/dotc/parsing/xml/SymbolicXMLBuilder.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class SymbolicXMLBuilder(parser: Parser, preserveWS: Boolean)(using Context) {
6666
import xmlterms.{_Null, __Elem, __Text, _buf, _md, _plus, _scope, _tmpscope, _xml}
6767

6868
// convenience methods
69-
private def LL[A](x: A*): List[List[A]] = List(List(x:_*))
69+
private def LL[A](x: A*): List[List[A]] = List(x.toList)
7070
private def const(x: Any) = Literal(Constant(x))
7171
private def wild = Ident(nme.WILDCARD)
7272
private def wildStar = Ident(tpnme.WILDCARD_STAR)
@@ -220,7 +220,7 @@ class SymbolicXMLBuilder(parser: Parser, preserveWS: Boolean)(using Context) {
220220
if (pre == null) (_scala_xml_UnprefixedAttribute, baseArgs)
221221
else (_scala_xml_PrefixedAttribute , const(pre) :: baseArgs)
222222

223-
Assign(Ident(_md), New(clazz, LL(attrArgs: _*)))
223+
Assign(Ident(_md), New(clazz, LL(attrArgs*)))
224224
}
225225

226226
def handlePrefixedAttribute(pre: String, key: String, value: Tree) = mkAttributeTree(pre, key, value)

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ object Formatting {
144144
case Nil => ("", Nil)
145145
}
146146
val (args1, suffixes1) = args.lazyZip(suffixes).map(treatArg(_, _)).unzip
147-
new StringContext(prefix :: suffixes1.toList: _*).s(args1: _*)
147+
new StringContext(prefix :: suffixes1.toList*).s(args1*)
148148
}
149149
}
150150

compiler/src/dotty/tools/dotc/quoted/Interpreter.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
171171
val clazz = inst.getClass
172172
val name = fn.name.asTermName
173173
val method = getMethod(clazz, name, paramsSig(fn))
174-
stopIfRuntimeException(method.invoke(inst, args: _*), method)
174+
stopIfRuntimeException(method.invoke(inst, args*), method)
175175
}
176176

177177
private def interpretedStaticFieldAccess(sym: Symbol): Object = {
@@ -186,8 +186,8 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
186186
private def interpretNew(fn: Symbol, args: List[Object]): Object = {
187187
val className = fn.owner.fullName.mangledString.replaceAll("\\$\\.", "\\$")
188188
val clazz = loadClass(className)
189-
val constr = clazz.getConstructor(paramsSig(fn): _*)
190-
constr.newInstance(args: _*).asInstanceOf[Object]
189+
val constr = clazz.getConstructor(paramsSig(fn)*)
190+
constr.newInstance(args*).asInstanceOf[Object]
191191
}
192192

193193
private def unexpectedTree(tree: Tree): Object =
@@ -218,7 +218,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
218218

219219

220220
private def getMethod(clazz: Class[?], name: Name, paramClasses: List[Class[?]]): JLRMethod =
221-
try clazz.getMethod(name.toString, paramClasses: _*)
221+
try clazz.getMethod(name.toString, paramClasses*)
222222
catch {
223223
case _: NoSuchMethodException =>
224224
val msg = em"Could not find method ${clazz.getCanonicalName}.$name with parameters ($paramClasses%, %)"

compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ private class ExtractAPICollector(using Context) extends ThunkHolder {
566566
case ExprType(resultType) =>
567567
withMarker(apiType(resultType), byNameMarker)
568568
case MatchType(bound, scrut, cases) =>
569-
val s = combineApiTypes(apiType(bound) :: apiType(scrut) :: cases.map(apiType): _*)
569+
val s = combineApiTypes(apiType(bound) :: apiType(scrut) :: cases.map(apiType)*)
570570
withMarker(s, matchMarker)
571571
case ConstantType(constant) =>
572572
api.Constant.of(apiType(constant.tpe), constant.stringValue)

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ object SpaceEngine {
149149
if (spaces.lengthCompare(1) <= 0 || spaces.lengthCompare(10) >= 0) spaces
150150
else {
151151
val res = spaces.map(sp => (sp, spaces.filter(_ ne sp))).find {
152-
case (sp, sps) => isSubspace(sp, Or(LazyList(sps: _*)))
152+
case (sp, sps) => isSubspace(sp, Or(LazyList(sps*)))
153153
}
154154
if (res.isEmpty) spaces
155155
else res.get._2
@@ -158,7 +158,7 @@ object SpaceEngine {
158158
/** Flatten space to get rid of `Or` for pretty print */
159159
def flatten(space: Space)(using Context): Seq[Space] = space match {
160160
case Prod(tp, fun, spaces) =>
161-
val ss = LazyList(spaces: _*).map(flatten)
161+
val ss = LazyList(spaces*).map(flatten)
162162

163163
ss.foldLeft(LazyList(Nil : List[Space])) { (acc, flat) =>
164164
for { sps <- acc; s <- flat }
@@ -168,7 +168,7 @@ object SpaceEngine {
168168
}
169169

170170
case Or(spaces) =>
171-
LazyList(spaces: _*).flatMap(flatten)
171+
LazyList(spaces*).flatMap(flatten)
172172

173173
case _ =>
174174
List(space)
@@ -272,7 +272,7 @@ object SpaceEngine {
272272
else if cache.forall(sub => isSubspace(sub.nn, Empty)) then Empty
273273
else
274274
// `(_, _, _) - (Some, None, _)` becomes `(None, _, _) | (_, Some, _) | (_, _, Empty)`
275-
val spaces = LazyList(range: _*).flatMap { i =>
275+
val spaces = LazyList(range*).flatMap { i =>
276276
flatten(sub(i)).map(s => Prod(tp1, fun1, ss1.updated(i, s)))
277277
}
278278
Or(spaces)
@@ -483,7 +483,7 @@ object SpaceEngine {
483483
case _ => tp
484484
})
485485

486-
/** Space of the pattern: unapplySeq(a, b, c: _*)
486+
/** Space of the pattern: unapplySeq(a, b, c*)
487487
*/
488488
def projectSeq(pats: List[Tree])(using Context): Space = {
489489
if (pats.isEmpty) return Typ(defn.NilType, false)

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ class Namer { typer: Typer =>
12971297
.foreach(addForwarder(name, _, span)) // ignore if any are not added
12981298

12991299
def addWildcardForwarders(seen: List[TermName], span: Span): Unit =
1300-
val nonContextual = mutable.HashSet(seen: _*)
1300+
val nonContextual = mutable.HashSet(seen*)
13011301
val fromCaseClass = pathType.widen.classSymbols.exists(_.is(Case))
13021302
def isCaseClassSynthesized(mbr: Symbol) =
13031303
fromCaseClass && defn.caseClassSynthesized.contains(mbr)

compiler/src/dotty/tools/io/ClassPath.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ trait ClassPath {
9494

9595
/** The whole classpath in the form of one String.
9696
*/
97-
def asClassPathString: String = ClassPath.join(asClassPathStrings: _*)
97+
def asClassPathString: String = ClassPath.join(asClassPathStrings*)
9898
// for compatibility purposes
9999
@deprecated("use asClassPathString instead of this one", "2.11.5")
100100
def asClasspathString: String = asClassPathString
@@ -152,7 +152,7 @@ object ClassPath {
152152
def join(paths: String*): String = paths.filterNot(_ == "").mkString(pathSeparator)
153153

154154
/** Split the classpath, apply a transformation function, and reassemble it. */
155-
def map(cp: String, f: String => String): String = join(split(cp) map f: _*)
155+
def map(cp: String, f: String => String): String = join(split(cp).map(f)*)
156156

157157
/** Expand path and possibly expanding stars */
158158
def expandPath(path: String, expandStar: Boolean = true): List[String] =

compiler/src/dotty/tools/io/Jar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Jar(file: File) {
6262
finally in.close()
6363
}
6464
def jarWriter(mainAttrs: (Attributes.Name, String)*): JarWriter = {
65-
new JarWriter(file, Jar.WManifest.apply(mainAttrs: _*).underlying)
65+
new JarWriter(file, Jar.WManifest.apply(mainAttrs*).underlying)
6666
}
6767

6868
def toList: List[JarEntry] = withJarInput { in =>

compiler/src/dotty/tools/runner/ScalaClassLoader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class RichClassLoader(private val self: ClassLoader) extends AnyVal {
3333
val method = clsToRun.getMethod("main", classOf[Array[String]])
3434
if !Modifier.isStatic(method.getModifiers) then
3535
throw new NoSuchMethodException(s"$objectName.main is not static")
36-
try asContext(method.invoke(null, Array(arguments.toArray: AnyRef): _*))
36+
try asContext(method.invoke(null, Array(arguments.toArray: AnyRef)*))
3737
catch unwrapHandler({ case ex => throw ex })
3838
}
3939

compiler/src/dotty/tools/scripting/Main.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object Main:
7373
)
7474
import dotty.tools.io.{Jar, Directory}
7575
val jar = new Jar(jarPath)
76-
val writer = jar.jarWriter(manifestAttributes:_*)
76+
val writer = jar.jarWriter(manifestAttributes*)
7777
try
7878
writer.writeAllFrom(Directory(outDir))
7979
finally

compiler/test-resources/repl/i3966

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
scala> val List(x: _*) = List(1, 2): @unchecked
1+
scala> val List(x*) = List(1, 2): @unchecked
22
val x: Seq[Int] = List(1, 2)

compiler/test/dotty/tools/CheckTypesTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CheckTypeTest extends DottyTest {
2424
"List[B]"
2525
)
2626

27-
checkTypes(source, types: _*) {
27+
checkTypes(source, types*) {
2828
case (List(a, b, lu, li, lr, ls, la, lb), context) =>
2929
given Context = context
3030

compiler/test/dotty/tools/backend/jvm/ArrayApplyOptTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,23 +109,23 @@ class ArrayApplyOptTest extends DottyBytecodeTest {
109109

110110
@Test def testArrayInlined = test(
111111
"""{
112-
| inline def array(inline xs: Int*): Array[Int] = Array(xs: _*)
112+
| inline def array(inline xs: Int*): Array[Int] = Array(xs*)
113113
| array(1, 2)
114114
|}""".stripMargin,
115115
newArray2Opcodes(T_INT, List(Op(DUP), Op(ICONST_0), Op(ICONST_1), Op(IASTORE), Op(DUP), Op(ICONST_1), Op(ICONST_2), Op(IASTORE), TypeOp(CHECKCAST, "[I")))
116116
)
117117

118118
@Test def testArrayInlined2 = test(
119119
"""{
120-
| inline def array(inline x: Int, inline xs: Int*): Array[Int] = Array(x, xs: _*)
120+
| inline def array(inline x: Int, inline xs: Int*): Array[Int] = Array(x, xs*)
121121
| array(1, 2)
122122
|}""".stripMargin,
123123
newArray2Opcodes(T_INT, List(Op(DUP), Op(ICONST_0), Op(ICONST_1), Op(IASTORE), Op(DUP), Op(ICONST_1), Op(ICONST_2), Op(IASTORE)))
124124
)
125125

126126
@Test def testArrayInlined3 = test(
127127
"""{
128-
| inline def array[T](inline xs: T*)(using inline ct: scala.reflect.ClassTag[T]): Array[T] = Array(xs: _*)
128+
| inline def array[T](inline xs: T*)(using inline ct: scala.reflect.ClassTag[T]): Array[T] = Array(xs*)
129129
| array(1, 2)
130130
|}""".stripMargin,
131131
newArray2Opcodes(T_INT, List(Op(DUP), Op(ICONST_0), Op(ICONST_1), Op(IASTORE), Op(DUP), Op(ICONST_1), Op(ICONST_2), Op(IASTORE), TypeOp(CHECKCAST, "[I")))

compiler/test/dotty/tools/backend/jvm/AsmConverters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ object ASMConverters {
245245
case Jump(op, label) => method.visitJumpInsn(op, asmLabel(label))
246246
case Ldc(op, cst) => method.visitLdcInsn(cst)
247247
case LookupSwitch(op, dflt, keys, labels) => method.visitLookupSwitchInsn(asmLabel(dflt), keys.toArray, (labels map asmLabel).toArray)
248-
case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray: _*)
248+
case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray*)
249249
case Invoke(op, owner, name, desc, itf) => method.visitMethodInsn(op, owner, name, desc, itf)
250250
case InvokeDynamic(op, name, desc, bsm, bsmArgs) => method.visitInvokeDynamicInsn(name, desc, unconvertMethodHandle(bsm), unconvertBsmArgs(bsmArgs))
251251
case NewArray(op, desc, dims) => method.visitMultiANewArrayInsn(desc, dims)

compiler/test/dotty/tools/backend/jvm/DottyBytecodeTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class DottyBytecodeTests extends DottyBytecodeTest {
308308
|import java.nio.file._
309309
|class Test {
310310
| def test(xs: Array[String]) = {
311-
| val p4 = Paths.get("Hello", xs: _*)
311+
| val p4 = Paths.get("Hello", xs*)
312312
| }
313313
|}
314314
""".stripMargin

compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class BootstrappedOnlyCompilationTests {
135135
if scala.util.Properties.isWin then basicTests
136136
else compileDir("tests/old-tasty-interpreter-prototype", withTastyInspectorOptions) :: basicTests
137137

138-
aggregateTests(tests: _*).checkRuns()
138+
aggregateTests(tests*).checkRuns()
139139
}
140140

141141
@Test def runBootstrappedOnly: Unit = {

compiler/test/dotty/tools/dotc/IdempotencyTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class IdempotencyTests {
4545
compileList(testDir.getName, sources.reverse, opt)(TestGroup("idempotency/orderIdempotency2"))
4646
)
4747
}
48-
aggregateTests(tests: _*)
48+
aggregateTests(tests*)
4949
}
5050

5151
def check(name: String) = {

compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class CommentPicklingTest {
9292
val out = tmp./("out")
9393
out.createDirectory()
9494

95-
val options = compileOptions.and("-d", out.toAbsolute.toString).and(sourceFiles: _*)
95+
val options = compileOptions.and("-d", out.toAbsolute.toString).and(sourceFiles*)
9696
val reporter = TestReporter.reporter(System.out, logLevel = ERROR)
9797
Main.process(options.all, reporter)
9898
assertFalse("Compilation failed.", reporter.hasErrors)

compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class SemanticdbTests:
130130
val target = Files.createTempDirectory("semanticdb")
131131
val javaArgs = Array("-d", target.toString) ++ javaFiles().map(_.toString)
132132
val javac = ToolProvider.getSystemJavaCompiler
133-
val exitJava = javac.run(null, null, null, javaArgs:_*)
133+
val exitJava = javac.run(null, null, null, javaArgs*)
134134
assert(exitJava == 0, "java compiler has errors")
135135
val args = Array(
136136
"-Xsemanticdb",

compiler/test/dotty/tools/scripting/ClasspathTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ClasspathTests:
4343
// cwd: <current-working-directory-seen-by-the-script>
4444
// classpath: <classpath-seen-by-the-script>
4545

46-
val scriptOutput: Seq[String] = exec(cmd:_*)
46+
val scriptOutput: Seq[String] = exec(cmd*)
4747
val scriptCwd: String = findTaggedLine("cwd", scriptOutput) // the value tagged "cwd: "
4848
printf("script ran in directory [%s]\n", scriptCwd)
4949
val scriptCp = findTaggedLine("classpath", scriptOutput) // the value tagged "classpath: "
@@ -94,7 +94,7 @@ class ClasspathTests:
9494
cmd.foreach { printf("[%s]\n", _) }
9595

9696
// test script reports the classpath it sees
97-
val scriptOutput = exec(cmd:_*)
97+
val scriptOutput = exec(cmd*)
9898
val scriptCp = findTaggedLine("unglobbed classpath", scriptOutput)
9999
printf("%s\n", scriptCp)
100100
val classpathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct

0 commit comments

Comments
 (0)