From 03946e4dfea4e55e7ba8405a67c984395dcf19e3 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 1 Nov 2023 09:20:48 +0100 Subject: [PATCH] Disallow `xs: _*` vararg syntax and use `xs*` instead --- .../tools/backend/jvm/BCodeBodyBuilder.scala | 2 +- .../tools/backend/jvm/BCodeIdiomatic.scala | 6 ++--- .../tools/backend/jvm/BackendUtils.scala | 2 +- .../tools/backend/jvm/ClassfileWriters.scala | 2 +- .../dotty/tools/backend/jvm/CoreBTypes.scala | 2 +- .../dotc/classpath/AggregateClassPath.scala | 2 +- .../dotty/tools/dotc/config/Settings.scala | 2 +- .../src/dotty/tools/dotc/core/Contexts.scala | 2 +- .../src/dotty/tools/dotc/core/Flags.scala | 2 +- .../src/dotty/tools/dotc/core/Types.scala | 2 +- .../dotty/tools/dotc/parsing/Parsers.scala | 8 +++---- .../src/dotty/tools/dotc/parsing/Tokens.scala | 2 +- .../dotc/parsing/xml/SymbolicXMLBuilder.scala | 4 ++-- .../tools/dotc/printing/Formatting.scala | 2 +- .../dotty/tools/dotc/quoted/Interpreter.scala | 8 +++---- .../src/dotty/tools/dotc/sbt/ExtractAPI.scala | 2 +- .../tools/dotc/transform/patmat/Space.scala | 10 ++++---- .../src/dotty/tools/dotc/typer/Namer.scala | 2 +- compiler/src/dotty/tools/io/ClassPath.scala | 4 ++-- compiler/src/dotty/tools/io/Jar.scala | 2 +- .../dotty/tools/runner/ScalaClassLoader.scala | 2 +- compiler/src/dotty/tools/scripting/Main.scala | 2 +- .../test/dotty/tools/CheckTypesTests.scala | 2 +- .../tools/backend/jvm/AsmConverters.scala | 2 +- .../BootstrappedOnlyCompilationTests.scala | 2 +- .../dotty/tools/dotc/IdempotencyTests.scala | 2 +- .../dotc/core/tasty/CommentPicklingTest.scala | 2 +- .../dotc/semanticdb/SemanticdbTests.scala | 2 +- .../tools/scripting/ClasspathTests.scala | 4 ++-- .../dotty/tools/vulpix/ParallelTesting.scala | 10 ++++---- library/src/scala/IArray.scala | 22 ++++++++--------- library/src/scala/quoted/Expr.scala | 2 +- library/src/scala/quoted/FromExpr.scala | 22 ++++++++--------- library/src/scala/quoted/ToExpr.scala | 24 +++++++++---------- library/src/scala/reflect/Selectable.scala | 4 ++-- library/src/scala/runtime/Arrays.scala | 2 +- library/src/scala/runtime/TupleXXL.scala | 2 +- .../parsers/WikiCodeBlockParser.scala | 2 +- .../scaladoc/renderers/HtmlRenderer.scala | 6 ++--- .../scaladoc/renderers/MemberRenderer.scala | 4 ++-- .../tools/scaladoc/renderers/Resources.scala | 2 +- .../renderers/SignatureRenderer.scala | 6 ++--- .../tasty/comments/MarkdownParser.scala | 2 +- .../scaladoc/tasty/comments/Preparser.scala | 2 +- .../src/dotty/tools/scaladoc/util/html.scala | 8 +++---- 45 files changed, 104 insertions(+), 104 deletions(-) diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala index 8aa79f4ee6da..3e9bbce2c0ae 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala @@ -1825,7 +1825,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder { else jliLambdaMetaFactoryMetafactoryHandle - bc.jmethod.visitInvokeDynamicInsn(methodName, desc, metafactory, bsmArgs: _*) + bc.jmethod.visitInvokeDynamicInsn(methodName, desc, metafactory, bsmArgs*) generatedType } diff --git a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala index 42f8ef7f4ef6..efd1ab19764d 100644 --- a/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala +++ b/compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala @@ -247,9 +247,9 @@ trait BCodeIdiomatic { ): Unit = { jmethod.visitInvokeDynamicInsn( "makeConcatWithConstants", - asm.Type.getMethodDescriptor(StringRef.toASMType, argTypes:_*), + asm.Type.getMethodDescriptor(StringRef.toASMType, argTypes*), coreBTypes.jliStringConcatFactoryMakeConcatWithConstantsHandle, - (recipe +: constants):_* + (recipe +: constants)* ) } @@ -522,7 +522,7 @@ trait BCodeIdiomatic { i += 1 } assert(oldPos == keys.length, "emitSWITCH") - jmethod.visitTableSwitchInsn(keyMin, keyMax, defaultBranch, newBranches: _*) + jmethod.visitTableSwitchInsn(keyMin, keyMax, defaultBranch, newBranches*) } else { jmethod.visitLookupSwitchInsn(defaultBranch, keys, branches) } diff --git a/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala b/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala index 668dedd6076e..840c58cb2314 100644 --- a/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala +++ b/compiler/src/dotty/tools/backend/jvm/BackendUtils.scala @@ -107,7 +107,7 @@ class BackendUtils(val postProcessor: PostProcessor) { val mv = cw.visitMethod(ACC_PRIVATE + ACC_STATIC + ACC_SYNTHETIC, "$deserializeLambda$", serializedLamdaObjDesc, null, null) def emitLambdaDeserializeIndy(targetMethods: Seq[Handle]): Unit = { mv.visitVarInsn(ALOAD, 0) - mv.visitInvokeDynamicInsn("lambdaDeserialize", serializedLamdaObjDesc, jliLambdaDeserializeBootstrapHandle, targetMethods: _*) + mv.visitInvokeDynamicInsn("lambdaDeserialize", serializedLamdaObjDesc, jliLambdaDeserializeBootstrapHandle, targetMethods*) } val targetMethodGroupLimit = 255 - 1 - 3 // JVM limit. See See MAX_MH_ARITY in CallSite.java diff --git a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala index 928d19c92041..ca45ec827108 100644 --- a/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala +++ b/compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala @@ -201,7 +201,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) { val parent = filePath.getParent if (!builtPaths.containsKey(parent)) { parent.iterator.forEachRemaining(checkName) - try Files.createDirectories(parent, noAttributes: _*) + try Files.createDirectories(parent, noAttributes*) catch { case e: FileAlreadyExistsException => // `createDirectories` reports this exception if `parent` is an existing symlink to a directory diff --git a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala index 0e65850d4798..95c0c596e0ce 100644 --- a/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala +++ b/compiler/src/dotty/tools/backend/jvm/CoreBTypes.scala @@ -233,7 +233,7 @@ abstract class CoreBTypesFromSymbols[I <: DottyBackendInterface] extends CoreBTy (List(LARRAY_LENGTH, LARRAY_GET, LARRAY_SET) map (_ -> LONG)) ++ (List(FARRAY_LENGTH, FARRAY_GET, FARRAY_SET) map (_ -> FLOAT)) ++ (List(DARRAY_LENGTH, DARRAY_GET, DARRAY_SET) map (_ -> DOUBLE)) ++ - (List(OARRAY_LENGTH, OARRAY_GET, OARRAY_SET) map (_ -> ObjectRef)) : _* + (List(OARRAY_LENGTH, OARRAY_GET, OARRAY_SET) map (_ -> ObjectRef)) * ) } } diff --git a/compiler/src/dotty/tools/dotc/classpath/AggregateClassPath.scala b/compiler/src/dotty/tools/dotc/classpath/AggregateClassPath.scala index 51b261583feb..5fbe7212a674 100644 --- a/compiler/src/dotty/tools/dotc/classpath/AggregateClassPath.scala +++ b/compiler/src/dotty/tools/dotc/classpath/AggregateClassPath.scala @@ -56,7 +56,7 @@ case class AggregateClassPath(aggregates: Seq[ClassPath]) extends ClassPath { override def asClassPathStrings: Seq[String] = aggregates.map(_.asClassPathString).distinct - override def asSourcePathString: String = ClassPath.join(aggregates map (_.asSourcePathString): _*) + override def asSourcePathString: String = ClassPath.join(aggregates map (_.asSourcePathString)*) override private[dotty] def packages(inPackage: PackageName): Seq[PackageEntry] = { val aggregatedPackages = aggregates.flatMap(_.packages(inPackage)).distinct diff --git a/compiler/src/dotty/tools/dotc/config/Settings.scala b/compiler/src/dotty/tools/dotc/config/Settings.scala index d992f5bdf2ee..5199c6727b41 100644 --- a/compiler/src/dotty/tools/dotc/config/Settings.scala +++ b/compiler/src/dotty/tools/dotc/config/Settings.scala @@ -24,7 +24,7 @@ object Settings: val OutputTag: ClassTag[AbstractFile] = ClassTag(classOf[AbstractFile]) class SettingsState(initialValues: Seq[Any]): - private val values = ArrayBuffer(initialValues: _*) + private val values = ArrayBuffer(initialValues*) private var _wasRead: Boolean = false override def toString: String = s"SettingsState(values: ${values.toList})" diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index f0a1453672e0..1404873c14d2 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -405,7 +405,7 @@ object Contexts { * from constructor parameters to class parameter accessors. */ def superCallContext: Context = { - val locals = newScopeWith(owner.typeParams ++ owner.asClass.paramAccessors: _*) + val locals = newScopeWith(owner.typeParams ++ owner.asClass.paramAccessors*) superOrThisCallContext(owner.primaryConstructor, locals) } diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index fa57c503d61b..47b5c9f17af2 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -188,7 +188,7 @@ object Flags { flag } - def commonFlags(flagss: FlagSet*): FlagSet = union(flagss.map(_.toCommonFlags): _*) + def commonFlags(flagss: FlagSet*): FlagSet = union(flagss.map(_.toCommonFlags)*) /** The empty flag set */ val EmptyFlags: FlagSet = FlagSet(0) diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index eb878b430183..5c9ec1da3498 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -5956,7 +5956,7 @@ object Types { val elems = scope.toList val elems1 = mapOver(elems) if (elems1 eq elems) scope - else newScopeWith(elems1: _*) + else newScopeWith(elems1*) } def mapOver(tree: Tree): Tree = treeTypeMap(tree) diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 48653ad96197..09b7aa8cc23c 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -2340,11 +2340,11 @@ object Parsers { in.nextToken() if isVarargSplice then report.errorOrMigrationWarning( - em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice(`future-migration`)}", + em"The syntax `x: _*` is no longer supported for vararg splices; use `x*` instead${rewriteNotice(`3.4-migration`)}", in.sourcePos(uscoreStart), - future) - if sourceVersion == `future-migration` then - patch(source, Span(t.span.end, in.lastOffset), " *") + `3.4`) + if sourceVersion == `3.4-migration` then + patch(source, Span(t.span.end, in.lastOffset), "*") else if opStack.nonEmpty then report.errorOrMigrationWarning( em"""`_*` can be used only for last argument of method application. diff --git a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala index 8a20009f1927..eea68594b08d 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Tokens.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Tokens.scala @@ -14,7 +14,7 @@ abstract class TokensCommon { type Token = Int type TokenSet = BitSet - def tokenRange(lo: Int, hi: Int): TokenSet = BitSet(lo to hi: _*) + def tokenRange(lo: Int, hi: Int): TokenSet = BitSet(lo to hi *) val tokenString, debugString: Array[String] = new Array[String](maxToken + 1) diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/SymbolicXMLBuilder.scala b/compiler/src/dotty/tools/dotc/parsing/xml/SymbolicXMLBuilder.scala index 0e70cc077fa4..43521b4a6305 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/SymbolicXMLBuilder.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/SymbolicXMLBuilder.scala @@ -66,7 +66,7 @@ class SymbolicXMLBuilder(parser: Parser, preserveWS: Boolean)(using Context) { import xmlterms.{_Null, __Elem, __Text, _buf, _md, _plus, _scope, _tmpscope, _xml} // convenience methods - private def LL[A](x: A*): List[List[A]] = List(List(x:_*)) + private def LL[A](x: A*): List[List[A]] = List(x.toList) private def const(x: Any) = Literal(Constant(x)) private def wild = Ident(nme.WILDCARD) private def wildStar = Ident(tpnme.WILDCARD_STAR) @@ -220,7 +220,7 @@ class SymbolicXMLBuilder(parser: Parser, preserveWS: Boolean)(using Context) { if (pre == null) (_scala_xml_UnprefixedAttribute, baseArgs) else (_scala_xml_PrefixedAttribute , const(pre) :: baseArgs) - Assign(Ident(_md), New(clazz, LL(attrArgs: _*))) + Assign(Ident(_md), New(clazz, LL(attrArgs*))) } def handlePrefixedAttribute(pre: String, key: String, value: Tree) = mkAttributeTree(pre, key, value) diff --git a/compiler/src/dotty/tools/dotc/printing/Formatting.scala b/compiler/src/dotty/tools/dotc/printing/Formatting.scala index 3f32b29654c9..c0be888955e9 100644 --- a/compiler/src/dotty/tools/dotc/printing/Formatting.scala +++ b/compiler/src/dotty/tools/dotc/printing/Formatting.scala @@ -144,7 +144,7 @@ object Formatting { case Nil => ("", Nil) } val (args1, suffixes1) = args.lazyZip(suffixes).map(treatArg(_, _)).unzip - new StringContext(prefix :: suffixes1.toList: _*).s(args1: _*) + new StringContext(prefix :: suffixes1.toList*).s(args1*) } } diff --git a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala index dbf4fe91a970..ef1ab91e3e2a 100644 --- a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala +++ b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala @@ -171,7 +171,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context): val clazz = inst.getClass val name = fn.name.asTermName val method = getMethod(clazz, name, paramsSig(fn)) - stopIfRuntimeException(method.invoke(inst, args: _*), method) + stopIfRuntimeException(method.invoke(inst, args*), method) } private def interpretedStaticFieldAccess(sym: Symbol): Object = { @@ -186,8 +186,8 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context): private def interpretNew(fn: Symbol, args: List[Object]): Object = { val className = fn.owner.fullName.mangledString.replaceAll("\\$\\.", "\\$") val clazz = loadClass(className) - val constr = clazz.getConstructor(paramsSig(fn): _*) - constr.newInstance(args: _*).asInstanceOf[Object] + val constr = clazz.getConstructor(paramsSig(fn)*) + constr.newInstance(args*).asInstanceOf[Object] } private def unexpectedTree(tree: Tree): Object = @@ -218,7 +218,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context): private def getMethod(clazz: Class[?], name: Name, paramClasses: List[Class[?]]): JLRMethod = - try clazz.getMethod(name.toString, paramClasses: _*) + try clazz.getMethod(name.toString, paramClasses*) catch { case _: NoSuchMethodException => val msg = em"Could not find method ${clazz.getCanonicalName}.$name with parameters ($paramClasses%, %)" diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 6398fe613b12..a1b43e463316 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -566,7 +566,7 @@ private class ExtractAPICollector(using Context) extends ThunkHolder { case ExprType(resultType) => withMarker(apiType(resultType), byNameMarker) case MatchType(bound, scrut, cases) => - val s = combineApiTypes(apiType(bound) :: apiType(scrut) :: cases.map(apiType): _*) + val s = combineApiTypes(apiType(bound) :: apiType(scrut) :: cases.map(apiType)*) withMarker(s, matchMarker) case ConstantType(constant) => api.Constant.of(apiType(constant.tpe), constant.stringValue) diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index 88c09eb4a521..7b5a80bc7b42 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -149,7 +149,7 @@ object SpaceEngine { if (spaces.lengthCompare(1) <= 0 || spaces.lengthCompare(10) >= 0) spaces else { val res = spaces.map(sp => (sp, spaces.filter(_ ne sp))).find { - case (sp, sps) => isSubspace(sp, Or(LazyList(sps: _*))) + case (sp, sps) => isSubspace(sp, Or(LazyList(sps*))) } if (res.isEmpty) spaces else res.get._2 @@ -158,7 +158,7 @@ object SpaceEngine { /** Flatten space to get rid of `Or` for pretty print */ def flatten(space: Space)(using Context): Seq[Space] = space match { case Prod(tp, fun, spaces) => - val ss = LazyList(spaces: _*).map(flatten) + val ss = LazyList(spaces*).map(flatten) ss.foldLeft(LazyList(Nil : List[Space])) { (acc, flat) => for { sps <- acc; s <- flat } @@ -168,7 +168,7 @@ object SpaceEngine { } case Or(spaces) => - LazyList(spaces: _*).flatMap(flatten) + LazyList(spaces*).flatMap(flatten) case _ => List(space) @@ -272,7 +272,7 @@ object SpaceEngine { else if cache.forall(sub => isSubspace(sub.nn, Empty)) then Empty else // `(_, _, _) - (Some, None, _)` becomes `(None, _, _) | (_, Some, _) | (_, _, Empty)` - val spaces = LazyList(range: _*).flatMap { i => + val spaces = LazyList(range*).flatMap { i => flatten(sub(i)).map(s => Prod(tp1, fun1, ss1.updated(i, s))) } Or(spaces) @@ -483,7 +483,7 @@ object SpaceEngine { case _ => tp }) - /** Space of the pattern: unapplySeq(a, b, c: _*) + /** Space of the pattern: unapplySeq(a, b, c*) */ def projectSeq(pats: List[Tree])(using Context): Space = { if (pats.isEmpty) return Typ(defn.NilType, false) diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index 647ac76d5243..efcb31b9824f 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -1289,7 +1289,7 @@ class Namer { typer: Typer => .foreach(addForwarder(name, _, span)) // ignore if any are not added def addWildcardForwarders(seen: List[TermName], span: Span): Unit = - val nonContextual = mutable.HashSet(seen: _*) + val nonContextual = mutable.HashSet(seen*) val fromCaseClass = pathType.widen.classSymbols.exists(_.is(Case)) def isCaseClassSynthesized(mbr: Symbol) = fromCaseClass && defn.caseClassSynthesized.contains(mbr) diff --git a/compiler/src/dotty/tools/io/ClassPath.scala b/compiler/src/dotty/tools/io/ClassPath.scala index b45de57f9850..ae4b9c63b528 100644 --- a/compiler/src/dotty/tools/io/ClassPath.scala +++ b/compiler/src/dotty/tools/io/ClassPath.scala @@ -94,7 +94,7 @@ trait ClassPath { /** The whole classpath in the form of one String. */ - def asClassPathString: String = ClassPath.join(asClassPathStrings: _*) + def asClassPathString: String = ClassPath.join(asClassPathStrings*) // for compatibility purposes @deprecated("use asClassPathString instead of this one", "2.11.5") def asClasspathString: String = asClassPathString @@ -152,7 +152,7 @@ object ClassPath { def join(paths: String*): String = paths.filterNot(_ == "").mkString(pathSeparator) /** Split the classpath, apply a transformation function, and reassemble it. */ - def map(cp: String, f: String => String): String = join(split(cp) map f: _*) + def map(cp: String, f: String => String): String = join(split(cp) map f*) /** Expand path and possibly expanding stars */ def expandPath(path: String, expandStar: Boolean = true): List[String] = diff --git a/compiler/src/dotty/tools/io/Jar.scala b/compiler/src/dotty/tools/io/Jar.scala index 9979a9ca9379..667dbd5965f8 100644 --- a/compiler/src/dotty/tools/io/Jar.scala +++ b/compiler/src/dotty/tools/io/Jar.scala @@ -62,7 +62,7 @@ class Jar(file: File) { finally in.close() } def jarWriter(mainAttrs: (Attributes.Name, String)*): JarWriter = { - new JarWriter(file, Jar.WManifest.apply(mainAttrs: _*).underlying) + new JarWriter(file, Jar.WManifest.apply(mainAttrs*).underlying) } def toList: List[JarEntry] = withJarInput { in => diff --git a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala index 9ec0199abcbb..2c0976fac1ac 100644 --- a/compiler/src/dotty/tools/runner/ScalaClassLoader.scala +++ b/compiler/src/dotty/tools/runner/ScalaClassLoader.scala @@ -33,7 +33,7 @@ final class RichClassLoader(private val self: ClassLoader) extends AnyVal { val method = clsToRun.getMethod("main", classOf[Array[String]]) if !Modifier.isStatic(method.getModifiers) then throw new NoSuchMethodException(s"$objectName.main is not static") - try asContext(method.invoke(null, Array(arguments.toArray: AnyRef): _*)) + try asContext(method.invoke(null, Array(arguments.toArray: AnyRef)*)) catch unwrapHandler({ case ex => throw ex }) } diff --git a/compiler/src/dotty/tools/scripting/Main.scala b/compiler/src/dotty/tools/scripting/Main.scala index 8db12f400c64..0b954cb79b26 100755 --- a/compiler/src/dotty/tools/scripting/Main.scala +++ b/compiler/src/dotty/tools/scripting/Main.scala @@ -73,7 +73,7 @@ object Main: ) import dotty.tools.io.{Jar, Directory} val jar = new Jar(jarPath) - val writer = jar.jarWriter(manifestAttributes:_*) + val writer = jar.jarWriter(manifestAttributes*) try writer.writeAllFrom(Directory(outDir)) finally diff --git a/compiler/test/dotty/tools/CheckTypesTests.scala b/compiler/test/dotty/tools/CheckTypesTests.scala index df4bc1636d82..290d8523df49 100644 --- a/compiler/test/dotty/tools/CheckTypesTests.scala +++ b/compiler/test/dotty/tools/CheckTypesTests.scala @@ -24,7 +24,7 @@ class CheckTypeTest extends DottyTest { "List[B]" ) - checkTypes(source, types: _*) { + checkTypes(source, types*) { case (List(a, b, lu, li, lr, ls, la, lb), context) => given Context = context diff --git a/compiler/test/dotty/tools/backend/jvm/AsmConverters.scala b/compiler/test/dotty/tools/backend/jvm/AsmConverters.scala index a7900994d402..c751937bd9f9 100644 --- a/compiler/test/dotty/tools/backend/jvm/AsmConverters.scala +++ b/compiler/test/dotty/tools/backend/jvm/AsmConverters.scala @@ -245,7 +245,7 @@ object ASMConverters { case Jump(op, label) => method.visitJumpInsn(op, asmLabel(label)) case Ldc(op, cst) => method.visitLdcInsn(cst) case LookupSwitch(op, dflt, keys, labels) => method.visitLookupSwitchInsn(asmLabel(dflt), keys.toArray, (labels map asmLabel).toArray) - case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray: _*) + case TableSwitch(op, min, max, dflt, labels) => method.visitTableSwitchInsn(min, max, asmLabel(dflt), (labels map asmLabel).toArray*) case Invoke(op, owner, name, desc, itf) => method.visitMethodInsn(op, owner, name, desc, itf) case InvokeDynamic(op, name, desc, bsm, bsmArgs) => method.visitInvokeDynamicInsn(name, desc, unconvertMethodHandle(bsm), unconvertBsmArgs(bsmArgs)) case NewArray(op, desc, dims) => method.visitMultiANewArrayInsn(desc, dims) diff --git a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala index 9529f94a3890..88b9fe0c649d 100644 --- a/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/BootstrappedOnlyCompilationTests.scala @@ -135,7 +135,7 @@ class BootstrappedOnlyCompilationTests { if scala.util.Properties.isWin then basicTests else compileDir("tests/old-tasty-interpreter-prototype", withTastyInspectorOptions) :: basicTests - aggregateTests(tests: _*).checkRuns() + aggregateTests(tests*).checkRuns() } @Test def runBootstrappedOnly: Unit = { diff --git a/compiler/test/dotty/tools/dotc/IdempotencyTests.scala b/compiler/test/dotty/tools/dotc/IdempotencyTests.scala index b515ebb05f96..81dd7d7f4710 100644 --- a/compiler/test/dotty/tools/dotc/IdempotencyTests.scala +++ b/compiler/test/dotty/tools/dotc/IdempotencyTests.scala @@ -45,7 +45,7 @@ class IdempotencyTests { compileList(testDir.getName, sources.reverse, opt)(TestGroup("idempotency/orderIdempotency2")) ) } - aggregateTests(tests: _*) + aggregateTests(tests*) } def check(name: String) = { diff --git a/compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala b/compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala index 0af4434fdcde..45b807f73079 100644 --- a/compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala +++ b/compiler/test/dotty/tools/dotc/core/tasty/CommentPicklingTest.scala @@ -92,7 +92,7 @@ class CommentPicklingTest { val out = tmp./("out") out.createDirectory() - val options = compileOptions.and("-d", out.toAbsolute.toString).and(sourceFiles: _*) + val options = compileOptions.and("-d", out.toAbsolute.toString).and(sourceFiles*) val reporter = TestReporter.reporter(System.out, logLevel = ERROR) Main.process(options.all, reporter) assertFalse("Compilation failed.", reporter.hasErrors) diff --git a/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala b/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala index de8c2c11f9c2..8839a6cd03b1 100644 --- a/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala +++ b/compiler/test/dotty/tools/dotc/semanticdb/SemanticdbTests.scala @@ -130,7 +130,7 @@ class SemanticdbTests: val target = Files.createTempDirectory("semanticdb") val javaArgs = Array("-d", target.toString) ++ javaFiles().map(_.toString) val javac = ToolProvider.getSystemJavaCompiler - val exitJava = javac.run(null, null, null, javaArgs:_*) + val exitJava = javac.run(null, null, null, javaArgs*) assert(exitJava == 0, "java compiler has errors") val args = Array( "-Xsemanticdb", diff --git a/compiler/test/dotty/tools/scripting/ClasspathTests.scala b/compiler/test/dotty/tools/scripting/ClasspathTests.scala index 0f3ada041538..4fd1211698f6 100755 --- a/compiler/test/dotty/tools/scripting/ClasspathTests.scala +++ b/compiler/test/dotty/tools/scripting/ClasspathTests.scala @@ -43,7 +43,7 @@ class ClasspathTests: // cwd: // classpath: - val scriptOutput: Seq[String] = exec(cmd:_*) + val scriptOutput: Seq[String] = exec(cmd*) val scriptCwd: String = findTaggedLine("cwd", scriptOutput) // the value tagged "cwd: " printf("script ran in directory [%s]\n", scriptCwd) val scriptCp = findTaggedLine("classpath", scriptOutput) // the value tagged "classpath: " @@ -94,7 +94,7 @@ class ClasspathTests: cmd.foreach { printf("[%s]\n", _) } // test script reports the classpath it sees - val scriptOutput = exec(cmd:_*) + val scriptOutput = exec(cmd*) val scriptCp = findTaggedLine("unglobbed classpath", scriptOutput) printf("%s\n", scriptCp) val classpathJars = scriptCp.split(psep).map { _.getName }.sorted.distinct diff --git a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala index 8d07002ac620..4804ffd349cb 100644 --- a/compiler/test/dotty/tools/vulpix/ParallelTesting.scala +++ b/compiler/test/dotty/tools/vulpix/ParallelTesting.scala @@ -85,18 +85,18 @@ trait ParallelTesting extends RunnerOrchestration { self => val newFlags = newFlags0.toArray if (!flags.options.containsSlice(newFlags)) self match { case self: JointCompilationSource => - self.copy(flags = flags.and(newFlags:_*)) + self.copy(flags = flags.and(newFlags*)) case self: SeparateCompilationSource => - self.copy(flags = flags.and(newFlags:_*)) + self.copy(flags = flags.and(newFlags*)) } else self } def withoutFlags(flags1: String*): TestSource = self match { case self: JointCompilationSource => - self.copy(flags = flags.without(flags1: _*)) + self.copy(flags = flags.without(flags1*)) case self: SeparateCompilationSource => - self.copy(flags = flags.without(flags1: _*)) + self.copy(flags = flags.without(flags1*)) } lazy val allToolArgs: ToolArgs = @@ -490,7 +490,7 @@ trait ParallelTesting extends RunnerOrchestration { self => def scalacOptions = toolArgs.getOrElse(ToolName.Scalac, Nil) val flags = flags0 - .and(scalacOptions: _*) + .and(scalacOptions*) .and("-d", targetDir.getPath) .withClasspath(targetDir.getPath) diff --git a/library/src/scala/IArray.scala b/library/src/scala/IArray.scala index 72124bdf8215..f4eae0cade82 100644 --- a/library/src/scala/IArray.scala +++ b/library/src/scala/IArray.scala @@ -411,25 +411,25 @@ object IArray: def emptyObjectIArray: IArray[Object] = Array.emptyObjectArray /** An immutable array with given elements. */ - def apply[T](xs: T*)(using ct: ClassTag[T]): IArray[T] = Array(xs: _*) + def apply[T](xs: T*)(using ct: ClassTag[T]): IArray[T] = Array(xs*) /** An immutable array with given elements. */ - def apply(x: Boolean, xs: Boolean*): IArray[Boolean] = Array(x, xs: _*) + def apply(x: Boolean, xs: Boolean*): IArray[Boolean] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Byte, xs: Byte*): IArray[Byte] = Array(x, xs: _*) + def apply(x: Byte, xs: Byte*): IArray[Byte] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Short, xs: Short*): IArray[Short] = Array(x, xs: _*) + def apply(x: Short, xs: Short*): IArray[Short] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Char, xs: Char*): IArray[Char] = Array(x, xs: _*) + def apply(x: Char, xs: Char*): IArray[Char] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Int, xs: Int*): IArray[Int] = Array(x, xs: _*) + def apply(x: Int, xs: Int*): IArray[Int] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Long, xs: Long*): IArray[Long] = Array(x, xs: _*) + def apply(x: Long, xs: Long*): IArray[Long] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Float, xs: Float*): IArray[Float] = Array(x, xs: _*) + def apply(x: Float, xs: Float*): IArray[Float] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Double, xs: Double*): IArray[Double] = Array(x, xs: _*) + def apply(x: Double, xs: Double*): IArray[Double] = Array(x, xs*) /** An immutable array with given elements. */ - def apply(x: Unit, xs: Unit*): IArray[Unit] = Array(x, xs: _*) + def apply(x: Unit, xs: Unit*): IArray[Unit] = Array(x, xs*) /** Build an array from the iterable collection. * @@ -459,7 +459,7 @@ object IArray: // `Array.concat` should arguably take in a `Seq[Array[_ <: T]]`, // but since it currently takes a `Seq[Array[T]]` we have to perform a cast, // knowing tacitly that `concat` is not going to do the wrong thing. - Array.concat[T](xss.asInstanceOf[Seq[Array[T]]]: _*) + Array.concat[T](xss.asInstanceOf[Seq[Array[T]]]*) /** Returns an immutable array that contains the results of some element computation a number * of times. Each element is determined by a separate computation. diff --git a/library/src/scala/quoted/Expr.scala b/library/src/scala/quoted/Expr.scala index 8243e7dc4a4b..03afedae8f49 100644 --- a/library/src/scala/quoted/Expr.scala +++ b/library/src/scala/quoted/Expr.scala @@ -69,7 +69,7 @@ object Expr { * `'{ List($e1, $e2, ...) }` typed as an `Expr[List[T]]` */ def ofList[T](xs: Seq[Expr[T]])(using Type[T])(using Quotes): Expr[List[T]] = - if (xs.isEmpty) Expr(Nil) else '{ List(${Varargs(xs)}: _*) } + if xs.isEmpty then Expr(Nil) else '{ List(${Varargs(xs)}*) } /** Creates an expression that will construct a copy of this tuple * diff --git a/library/src/scala/quoted/FromExpr.scala b/library/src/scala/quoted/FromExpr.scala index f81afc627609..aadea9bcb0b6 100644 --- a/library/src/scala/quoted/FromExpr.scala +++ b/library/src/scala/quoted/FromExpr.scala @@ -133,13 +133,13 @@ object FromExpr { } /** Default implementation of `FromExpr[StringContext]` - * - Transform `'{StringContext(args: _*)}` into `Some(StringContext(args: _*))` if `args` is explicit and each one is liftable + * - Transform `'{StringContext(args*)}` into `Some(StringContext(args*))` if `args` is explicit and each one is liftable * - Otherwise returns `None` */ given StringContextFromExpr: FromExpr[StringContext] with { def unapply(x: Expr[StringContext])(using Quotes) = x match { - case '{ new StringContext(${Varargs(Exprs(args))}: _*) } => Some(StringContext(args: _*)) - case '{ StringContext(${Varargs(Exprs(args))}: _*) } => Some(StringContext(args: _*)) + case '{ new StringContext(${Varargs(Exprs(args))}*) } => Some(StringContext(args*)) + case '{ StringContext(${Varargs(Exprs(args))}*) } => Some(StringContext(args*)) case _ => None } } @@ -428,8 +428,8 @@ object FromExpr { given SeqFromExpr[T](using Type[T], FromExpr[T]): FromExpr[Seq[T]] with { def unapply(x: Expr[Seq[T]])(using Quotes) = x match { case Varargs(Exprs(elems)) => Some(elems) - case '{ scala.Seq[T](${Varargs(Exprs(elems))}: _*) } => Some(elems) - case '{ scala.collection.immutable.Seq[T](${Varargs(Exprs(elems))}: _*) } => Some(elems) + case '{ scala.Seq[T](${Varargs(Exprs(elems))}*) } => Some(elems) + case '{ scala.collection.immutable.Seq[T](${Varargs(Exprs(elems))}*) } => Some(elems) case '{ ${Expr(x)}: List[T] } => Some(x) case _ => None } @@ -454,10 +454,10 @@ object FromExpr { */ given ListFromExpr[T](using Type[T], FromExpr[T]): FromExpr[List[T]] with { def unapply(x: Expr[List[T]])(using Quotes) = x match { - case '{ scala.List[T](${Varargs(Exprs(elems))}: _*) } => Some(elems.toList) + case '{ scala.List[T](${Varargs(Exprs(elems))}*) } => Some(elems.toList) case '{ scala.List.empty[T] } => Some(Nil) case '{ Nil } => Some(Nil) - case '{ scala.collection.immutable.List[T](${Varargs(Exprs(elems))}: _*) } => Some(elems.toList) + case '{ scala.collection.immutable.List[T](${Varargs(Exprs(elems))}*) } => Some(elems.toList) case '{ scala.collection.immutable.List.empty[T] } => Some(Nil) case _ => None } @@ -470,9 +470,9 @@ object FromExpr { */ given SetFromExpr[T](using Type[T], FromExpr[T]): FromExpr[Set[T]] with { def unapply(x: Expr[Set[T]])(using Quotes) = x match { - case '{ Set[T](${Varargs(Exprs(elems))}: _*) } => Some(elems.toSet) + case '{ Set[T](${Varargs(Exprs(elems))}*) } => Some(elems.toSet) case '{ Set.empty[T] } => Some(Set.empty[T]) - case '{ scala.collection.immutable.Set[T](${Varargs(Exprs(elems))}: _*) } => Some(elems.toSet) + case '{ scala.collection.immutable.Set[T](${Varargs(Exprs(elems))}*) } => Some(elems.toSet) case '{ scala.collection.immutable.Set.empty[T] } => Some(Set.empty[T]) case _ => None } @@ -485,9 +485,9 @@ object FromExpr { */ given MapFromExpr[T, U](using Type[T], Type[U], FromExpr[T], FromExpr[U]): FromExpr[Map[T, U]] with { def unapply(x: Expr[Map[T, U]])(using Quotes) = x match { - case '{ Map[T, U](${Varargs(Exprs(elems))}: _*) } => Some(elems.toMap) + case '{ Map[T, U](${Varargs(Exprs(elems))}*) } => Some(elems.toMap) case '{ Map.empty[T, U] } => Some(Map.empty) - case '{ scala.collection.immutable.Map[T, U](${Varargs(Exprs(elems))}: _*) } => Some(elems.toMap) + case '{ scala.collection.immutable.Map[T, U](${Varargs(Exprs(elems))}*) } => Some(elems.toMap) case '{ scala.collection.immutable.Map.empty[T, U] } => Some(Map.empty) case _ => None } diff --git a/library/src/scala/quoted/ToExpr.scala b/library/src/scala/quoted/ToExpr.scala index 0e31c4590a26..883b55833af5 100644 --- a/library/src/scala/quoted/ToExpr.scala +++ b/library/src/scala/quoted/ToExpr.scala @@ -97,63 +97,63 @@ object ToExpr { /** Default implementation of `ToExpr[Array[T]]` */ given ArrayToExpr[T: Type: ToExpr: ClassTag]: ToExpr[Array[T]] with { def apply(arr: Array[T])(using Quotes): Expr[Array[T]] = - '{ Array[T](${Expr(arr.toSeq)}: _*)(${Expr(summon[ClassTag[T]])}) } + '{ Array[T](${Expr(arr.toSeq)}*)(${Expr(summon[ClassTag[T]])}) } } /** Default implementation of `ToExpr[Array[Boolean]]` */ given ArrayOfBooleanToExpr: ToExpr[Array[Boolean]] with { def apply(array: Array[Boolean])(using Quotes): Expr[Array[Boolean]] = if (array.length == 0) '{ Array.emptyBooleanArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Byte]]` */ given ArrayOfByteToExpr: ToExpr[Array[Byte]] with { def apply(array: Array[Byte])(using Quotes): Expr[Array[Byte]] = if (array.length == 0) '{ Array.emptyByteArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Short]]` */ given ArrayOfShortToExpr: ToExpr[Array[Short]] with { def apply(array: Array[Short])(using Quotes): Expr[Array[Short]] = if (array.length == 0) '{ Array.emptyShortArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Char]]` */ given ArrayOfCharToExpr: ToExpr[Array[Char]] with { def apply(array: Array[Char])(using Quotes): Expr[Array[Char]] = if (array.length == 0) '{ Array.emptyCharArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Int]]` */ given ArrayOfIntToExpr: ToExpr[Array[Int]] with { def apply(array: Array[Int])(using Quotes): Expr[Array[Int]] = if (array.length == 0) '{ Array.emptyIntArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Long]]` */ given ArrayOfLongToExpr: ToExpr[Array[Long]] with { def apply(array: Array[Long])(using Quotes): Expr[Array[Long]] = if (array.length == 0) '{ Array.emptyLongArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Float]]` */ given ArrayOfFloatToExpr: ToExpr[Array[Float]] with { def apply(array: Array[Float])(using Quotes): Expr[Array[Float]] = if (array.length == 0) '{ Array.emptyFloatArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[Array[Double]]` */ given ArrayOfDoubleToExpr: ToExpr[Array[Double]] with { def apply(array: Array[Double])(using Quotes): Expr[Array[Double]] = if (array.length == 0) '{ Array.emptyDoubleArray } - else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}: _*) } + else '{ Array(${Expr(array(0))}, ${Expr(array.toSeq.tail)}*) } } /** Default implementation of `ToExpr[IArray[T]]` */ @@ -183,13 +183,13 @@ object ToExpr { /** Default implementation of `ToExpr[Set[T]]` */ given SetToExpr[T: Type: ToExpr]: ToExpr[Set[T]] with { def apply(set: Set[T])(using Quotes): Expr[Set[T]] = - '{ Set(${Expr(set.toSeq)}: _*) } + '{ Set(${Expr(set.toSeq)}*) } } /** Default implementation of `ToExpr[Map[T, U]]` */ given MapToExpr[T: Type: ToExpr, U: Type: ToExpr]: ToExpr[Map[T, U]] with { def apply(map: Map[T, U])(using Quotes): Expr[Map[T, U]] = - '{ Map(${Expr(map.toSeq)}: _*) } + '{ Map(${Expr(map.toSeq)}*) } } /** Default implementation of `ToExpr[Option[T]]` */ @@ -430,7 +430,7 @@ object ToExpr { given StringContextToExpr: ToExpr[StringContext] with { def apply(stringContext: StringContext)(using Quotes): Expr[StringContext] = val parts = Varargs(stringContext.parts.map(Expr(_))) - '{ StringContext($parts: _*) } + '{ StringContext($parts*) } } } diff --git a/library/src/scala/reflect/Selectable.scala b/library/src/scala/reflect/Selectable.scala index f0bc1f197f5d..ff1d3ee21e79 100644 --- a/library/src/scala/reflect/Selectable.scala +++ b/library/src/scala/reflect/Selectable.scala @@ -35,9 +35,9 @@ trait Selectable extends scala.Selectable: */ final def applyDynamic(name: String, paramTypes: Class[_]*)(args: Any*): Any = val rcls = selectedValue.getClass - val mth = rcls.getMethod(name, paramTypes: _*).nn + val mth = rcls.getMethod(name, paramTypes*).nn ensureAccessible(mth) - mth.invoke(selectedValue, args.asInstanceOf[Seq[AnyRef]]: _*) + mth.invoke(selectedValue, args.asInstanceOf[Seq[AnyRef]]*) object Selectable: diff --git a/library/src/scala/runtime/Arrays.scala b/library/src/scala/runtime/Arrays.scala index 2d98caea4df8..d86213dbb62d 100644 --- a/library/src/scala/runtime/Arrays.scala +++ b/library/src/scala/runtime/Arrays.scala @@ -27,5 +27,5 @@ object Arrays { /** Create an array of a reference type T. */ def newArray[Arr](componentType: Class[_], returnType: Class[Arr], dimensions: Array[Int]): Arr = - jlr.Array.newInstance(componentType, dimensions: _*).asInstanceOf[Arr] + jlr.Array.newInstance(componentType, dimensions*).asInstanceOf[Arr] } diff --git a/library/src/scala/runtime/TupleXXL.scala b/library/src/scala/runtime/TupleXXL.scala index 22c3cc521427..b4a81d60f817 100644 --- a/library/src/scala/runtime/TupleXXL.scala +++ b/library/src/scala/runtime/TupleXXL.scala @@ -43,6 +43,6 @@ final class TupleXXL private (es: IArray[Object]) extends Product { object TupleXXL { def fromIterator(elems: Iterator[Any]): TupleXXL = new TupleXXL(elems.map(_.asInstanceOf[Object]).toArray.asInstanceOf[IArray[Object]]) // TODO use Iterator.toIArray def fromIArray(elems: IArray[Object]): TupleXXL = new TupleXXL(elems) - def apply(elems: Any*): TupleXXL = new TupleXXL(IArray(elems.asInstanceOf[Seq[AnyRef]]: _*)) + def apply(elems: Any*): TupleXXL = new TupleXXL(IArray(elems.asInstanceOf[Seq[AnyRef]]*)) def unapplySeq(x: TupleXXL): Option[Seq[Any]] = Some(x.elems.asInstanceOf[Array[Object]].toSeq) // TODO use IArray.toSeq } diff --git a/scaladoc/src/dotty/tools/scaladoc/parsers/WikiCodeBlockParser.scala b/scaladoc/src/dotty/tools/scaladoc/parsers/WikiCodeBlockParser.scala index 4201cae4e2e6..e6ebe0d2cc7a 100644 --- a/scaladoc/src/dotty/tools/scaladoc/parsers/WikiCodeBlockParser.scala +++ b/scaladoc/src/dotty/tools/scaladoc/parsers/WikiCodeBlockParser.scala @@ -142,7 +142,7 @@ class WikiCodeBlockParser( codeBlock.setCharsFromContent block.appendChild(codeBlock) } else { - val codeBlock = new Text(SegmentedSequence.create(segments.asScala.toSeq:_*)) + val codeBlock = new Text(SegmentedSequence.create(segments.asScala.toSeq*)) block.appendChild(codeBlock) } } diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala index 872f8a4f09c9..20f3335a44ef 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/HtmlRenderer.scala @@ -32,8 +32,8 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do case _ => Nil) :+ (Attr("data-pathToRoot") := pathToRoot(page.link.dri)) - val htmlTag = html(attrs: _*)( - head((mkHead(page) :+ docHead):_*), + val htmlTag = html(attrs*)( + head((mkHead(page) :+ docHead)*), body( if !page.hasFrame then docBody else mkFrame(page.link, parents, docBody, toc) @@ -216,7 +216,7 @@ class HtmlRenderer(rootPackage: Member, members: Map[DRI, Member])(using ctx: Do a(href := pathToPage(link.dri, b.dri))(b.name), "/" )).dropRight(1) - div(cls := "breadcrumbs container")(innerTags:_*) + div(cls := "breadcrumbs container")(innerTags*) val (apiNavOpt, docsNavOpt): (Option[(Boolean, Seq[AppliedTag])], Option[(Boolean, Seq[AppliedTag])]) = buildNavigation(link) diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala index 996b422b44fd..612444fd4ffd 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/MemberRenderer.scala @@ -26,7 +26,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext val headNode = m.inheritedFrom.map(form => signatureRenderer.renderLink(form.name, form.dri)) val tailNodes = defs.flatMap(renderDef) val nodes = headNode.fold(tailNodes.drop(1))(_ +: tailNodes) - tableRow("Definition Classes", div(nodes:_*)) + tableRow("Definition Classes", div(nodes*)) case _ => Nil @@ -250,7 +250,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext val memberInf = memberInfo(member, withBrief = true) val annots = annotations(member) - div(topLevelAttr:_*)( + div(topLevelAttr*)( div(cls := "documentableElement-expander")( Option.when(annots.nonEmpty || originInf.nonEmpty || memberInf.nonEmpty)(button(cls := "icon-button ar show-content")).toList, annots.map(div(_)).toList, diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala index b84c07b4bade..3e49af2e0576 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/Resources.scala @@ -20,7 +20,7 @@ enum Resource(val path: String): trait Resources(using ctx: DocContext) extends Locations, Writer: private def dynamicJsData = val str = jsonObject("filterDefaults" -> jsonObject( - FilterAttributes.defaultValues.toSeq.map { case (n, v) => n -> jsonString(v) }:_* + FilterAttributes.defaultValues.toSeq.map { case (n, v) => n -> jsonString(v) }* )) Resource.Text("scripts/data.js", s"var scaladocData = $str") diff --git a/scaladoc/src/dotty/tools/scaladoc/renderers/SignatureRenderer.scala b/scaladoc/src/dotty/tools/scaladoc/renderers/SignatureRenderer.scala index 5c6235b14e7d..65c67d3457a5 100644 --- a/scaladoc/src/dotty/tools/scaladoc/renderers/SignatureRenderer.scala +++ b/scaladoc/src/dotty/tools/scaladoc/renderers/SignatureRenderer.scala @@ -18,7 +18,7 @@ trait SignatureRenderer: def renderElement(e: SignaturePart, modifiers: AppliedAttr*): AppliedTag = renderElementWith(e, modifiers*) def renderLink(name: String, dri: DRI, modifiers: AppliedAttr*) = - renderLinkContent(name, dri, modifiers:_*) + renderLinkContent(name, dri, modifiers*) def unresolvedLink(content: TagArg, modifiers: AppliedAttr*) = span(Attr("data-unresolved-link") := "", modifiers)(content) @@ -26,7 +26,7 @@ trait SignatureRenderer: def renderLinkContent(content: TagArg, dri: DRI, modifiers: AppliedAttr*) = link(dri) match case Some(link) => a(href := link, modifiers)(content) - case _ => unresolvedLink(content, modifiers:_*) + case _ => unresolvedLink(content, modifiers*) def renderElementWith(e: SignaturePart, modifiers: AppliedAttr*) = e match case Name(name, dri) => @@ -34,7 +34,7 @@ trait SignatureRenderer: renderLink(name, dri, attrs*) case Type(name, Some(dri)) => val attrs = Seq(Attr("t") := "t") ++ modifiers - renderLink(name, dri, attrs:_*) + renderLink(name, dri, attrs*) case Type(name, None) => span(Attr("t") := "t")(name) case Keyword(name) => span(Attr("t") := "k")(name) case Plain(name) => raw(name) diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/MarkdownParser.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/MarkdownParser.scala index edf9051c0ed7..77d57748a2e8 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/MarkdownParser.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/MarkdownParser.scala @@ -38,7 +38,7 @@ object MarkdownParser { new MutableDataSet() .setFrom(ParserEmulationProfile.COMMONMARK.getOptions) - .set(Parser.EXTENSIONS, Arrays.asList(extArray:_*)) + .set(Parser.EXTENSIONS, Arrays.asList(extArray*)) .set(EmojiExtension.ROOT_IMAGE_PATH, "https://github.global.ssl.fastly.net/images/icons/emoji/") .set(WikiLinkExtension.LINK_ESCAPE_CHARS, "") diff --git a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/Preparser.scala b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/Preparser.scala index 95db8983626a..9fad9e22eeb9 100644 --- a/scaladoc/src/dotty/tools/scaladoc/tasty/comments/Preparser.scala +++ b/scaladoc/src/dotty/tools/scaladoc/tasty/comments/Preparser.scala @@ -130,7 +130,7 @@ object Preparser { val tagsWithoutDiagram = tags.filterNot(pair => stripTags.contains(pair._1)) val bodyTags: mutable.Map[TagKey, List[String]] = - mutable.Map((tagsWithoutDiagram).toSeq: _*) + mutable.Map((tagsWithoutDiagram).toSeq*) def allTags(key: SimpleTagKey): List[String] = (bodyTags remove key).getOrElse(Nil).reverse diff --git a/scaladoc/src/dotty/tools/scaladoc/util/html.scala b/scaladoc/src/dotty/tools/scaladoc/util/html.scala index 9d832d28ee0b..f7d99eaf4927 100644 --- a/scaladoc/src/dotty/tools/scaladoc/util/html.scala +++ b/scaladoc/src/dotty/tools/scaladoc/util/html.scala @@ -9,8 +9,8 @@ object HTML: type TagArg = AppliedTag | Seq[AppliedTag] | String | Seq[String] case class Tag(name: String): - def apply(tags: TagArg*): AppliedTag = apply()(tags:_*) - def apply(first: AttrArg, rest: AttrArg*): AppliedTag = apply((first +: rest):_*)() + def apply(tags: TagArg*): AppliedTag = apply()(tags*) + def apply(first: AttrArg, rest: AttrArg*): AppliedTag = apply((first +: rest)*)() def apply(attrs: AttrArg*)(tags: TagArg*): AppliedTag = def unpackTags(tags: TagArg*)(using sb: StringBuilder): StringBuilder = tags.foreach { @@ -19,7 +19,7 @@ object HTML: case s: String => sb.append(s.escapeReservedTokens) case s: Seq[AppliedTag | String] => - unpackTags(s:_*) + unpackTags(s*) } sb val sb = StringBuilder() @@ -31,7 +31,7 @@ object HTML: sb.append(" ").append(e) } sb.append(">") - unpackTags(tags:_*)(using sb) + unpackTags(tags*)(using sb) sb.append(s"") sb