diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-11-26 10:34:45 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-11-26 10:34:45 +0000 |
commit | cf8c15946e70fd0016f22de4811a2d44221ffd13 (patch) | |
tree | 7fd9f0168387b25d86db495c2d8207abd396219e /src/compiler | |
parent | 575f7c33e09901c8008a99d930b3efa9deb7acf0 (diff) | |
download | scala-cf8c15946e70fd0016f22de4811a2d44221ffd13.tar.gz scala-cf8c15946e70fd0016f22de4811a2d44221ffd13.tar.bz2 scala-cf8c15946e70fd0016f22de4811a2d44221ffd13.zip |
Further work on #3621.
No review.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/UnCurry.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala index 7538043d8f..1b48b9a978 100644 --- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala +++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala @@ -740,7 +740,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers with ast.Tr // e.g. def foo[T](a: Int, b: T*) // becomes def foo[T](a: Int, b: Array[Object]) // instead of def foo[T](a: Int, b: Array[T]) ===> def foo[T](a: Int, b: Object) - if (tparg.typeSymbol.isTypeSkolem) arrayType(ObjectClass.tpe) else arrayType(tparg) + if (tparg.typeSymbol.isTypeParameterOrSkolem) arrayType(ObjectClass.tpe) else arrayType(tparg) } def toSeqType(tp: Type): Type = tp match { case TypeRef(_, ArrayClass, List(tparg)) => seqType(tparg) @@ -778,25 +778,25 @@ abstract class UnCurry extends InfoTransform with TypingTransformers with ast.Tr // create the tree val forwtree = theTyper.typed { - val locals: List[ValDef] = for ((argsym, fp) <- (forwsym ARGS) zip flatparams) yield + val locals: List[Tree] = for ((argsym, fp) <- (forwsym ARGS) zip flatparams) yield if (rpsymbols contains fp.symbol) - VAL(forwsym.newValue(unit.fresh.newName("param$")).setInfo(fp.symbol.tpe)) === { + Block(Nil, gen.mkCast( gen.mkWrapArray(Ident(argsym), arrayElemType(argsym.tpe)), seqType(seqElemType(fp.symbol.tpe)) ) - } + ) else null - val emitted = for (l <- locals if l != null) yield l val seqargs = for ((l, argsym) <- locals zip (forwsym ARGS)) yield if (l == null) Ident(argsym) - else Ident(l.symbol) + else l + val end = if (forwsym.isConstructor) List(UNIT) else Nil atPos(dd.pos) { val t = DEF(forwsym) === BLOCK { - (emitted ::: List( - Apply(REF(flatdd.symbol), seqargs) - )): _* + (List( + Apply(gen.mkAttributedRef(flatdd.symbol), seqargs) + ) ::: end): _* } t } |