diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-23 00:36:18 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-23 02:27:05 -0800 |
commit | d5006b118f6ad1bf10ed35491cd0bda05fc88972 (patch) | |
tree | d76b018d1de05407467af068e68d8b74d73fe977 /src/compiler/scala/tools/nsc/javac | |
parent | 4a984f82d5bfca05123c53bd385d0299818f8a75 (diff) | |
download | scala-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/javac')
-rw-r--r-- | src/compiler/scala/tools/nsc/javac/JavaParsers.scala | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index 3490c1f5a8..62f6c90fba 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -653,10 +653,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { // leaves auxiliary constructors unable to access members of the companion object // as unqualified identifiers. def addCompanionObject(statics: List[Tree], cdef: ClassDef): List[Tree] = { - def implWithImport(importStmt: Tree) = { - import cdef.impl._ - treeCopy.Template(cdef.impl, parents, self, importStmt :: body) - } + def implWithImport(importStmt: Tree) = deriveTemplate(cdef.impl)(importStmt :: _) // if there are no statics we can use the original cdef, but we always // create the companion so import A._ is not an error (see ticket #1700) val cdefNew = |