summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/UnCurry.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-23 00:36:18 -0800
committerPaul Phillips <paulp@improving.org>2012-02-23 02:27:05 -0800
commitd5006b118f6ad1bf10ed35491cd0bda05fc88972 (patch)
treed76b018d1de05407467af068e68d8b74d73fe977 /src/compiler/scala/tools/nsc/transform/UnCurry.scala
parent4a984f82d5bfca05123c53bd385d0299818f8a75 (diff)
downloadscala-d5006b118f6ad1bf10ed35491cd0bda05fc88972.tar.gz
scala-d5006b118f6ad1bf10ed35491cd0bda05fc88972.tar.bz2
scala-d5006b118f6ad1bf10ed35491cd0bda05fc88972.zip
Methods to derive ValDefs and Templates.
It's a lot like the last one. I also found trees being duplicated before being sent to the tree copier. Looks like xerox has gotten a mole in here. Trust no one.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/UnCurry.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index 4b587a3f41..23673c2a1d 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -620,13 +620,11 @@ abstract class UnCurry extends InfoTransform
* In particular, this case will add:
* - synthetic Java varargs forwarders for repeated parameters
*/
- case Template(parents, self, body) =>
+ case Template(_, _, _) =>
localTyper = typer.atOwner(tree, currentClass)
- val tmpl = if (!forMSIL || forMSIL) {
- treeCopy.Template(tree, parents, self, transformTrees(newMembers.toList) ::: body)
- } else super.transform(tree).asInstanceOf[Template]
- newMembers.clear
- tmpl
+ try deriveTemplate(tree)(transformTrees(newMembers.toList) ::: _)
+ finally newMembers.clear()
+
case dd @ DefDef(_, _, _, vparamss0, _, rhs0) =>
val flatdd = copyDefDef(dd)(
vparamss = List(vparamss0.flatten),