@@ -15,9 +15,9 @@ package tools.nsc
15
15
package transform
16
16
17
17
import scala .annotation .tailrec
18
-
19
18
import symtab .Flags ._
20
19
import scala .collection .mutable
20
+ import scala .collection .mutable .ListBuffer
21
21
import scala .reflect .internal .util .ListOfNil
22
22
23
23
/* <export> */
@@ -250,12 +250,12 @@ abstract class UnCurry extends InfoTransform
250
250
def transformArgs (pos : Position , fun : Symbol , args : List [Tree ], params : List [Symbol ]): List [Tree ] = {
251
251
val isJava = fun.isJavaDefined
252
252
253
- def transformVarargs (varargsElemType : Type ) = {
253
+ def transformVarargs (varargsElemType : Type ): List [ Tree ] = {
254
254
def mkArrayValue (ts : List [Tree ], elemtp : Type ) =
255
255
ArrayValue (TypeTree (elemtp), ts) setType arrayType(elemtp)
256
256
257
257
// when calling into scala varargs, make sure it's a sequence.
258
- def arrayToSequence (tree : Tree , elemtp : Type , copy : Boolean ) = {
258
+ def arrayToSequence (tree : Tree , elemtp : Type , copy : Boolean ): Tree = {
259
259
exitingUncurry {
260
260
localTyper.typedPos(pos) {
261
261
val pt = arrayType(elemtp)
@@ -274,7 +274,7 @@ abstract class UnCurry extends InfoTransform
274
274
}
275
275
276
276
// when calling into java varargs, make sure it's an array - see bug #1360
277
- def sequenceToArray (tree : Tree ) = {
277
+ def sequenceToArray (tree : Tree ): Tree = {
278
278
val toArraySym = tree.tpe member nme.toArray
279
279
assert(toArraySym != NoSymbol )
280
280
def getClassTag (tp : Type ): Tree = {
@@ -329,7 +329,10 @@ abstract class UnCurry extends InfoTransform
329
329
}
330
330
}
331
331
}
332
- args.take(params.length - 1 ) :+ (suffix setType params.last.info)
332
+ val args1 = ListBuffer [Tree ]()
333
+ args1 ++= args.iterator.take(params.length - 1 )
334
+ args1 += suffix setType params.last.info
335
+ args1.toList
333
336
}
334
337
335
338
val isVarargs = isVarArgsList(params)
0 commit comments