From b26f12d4b116799e8860ddfd27ad398bc0c80b6a Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 9 Dec 2012 19:40:29 -0800 Subject: Cleanup in module var creation. When all the logic in a method is for symbol creation, and then at the last minute it throws on a hastily zipped ValDef, it's really not a tree generation method, it's a symbol creation method. Eliminated redundancy and overgeneralization; marked some bits for further de-duplication. Did my best with my limited archeological skills to document what is supposed to be happening in eliminateModuleDefs. --- src/compiler/scala/tools/nsc/transform/CleanUp.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/transform/CleanUp.scala') diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 765ef39e6b..39460ef004 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -620,9 +620,8 @@ abstract class CleanUp extends Transform with ast.TreeDSL { // create a symbol for the static field val stfieldSym = ( currentClass.newVariable(mkTerm("symbol$"), pos, PRIVATE | STATIC | SYNTHETIC | FINAL) - setInfo SymbolClass.tpe + setInfoAndEnter SymbolClass.tpe ) - currentClass.info.decls enter stfieldSym // create field definition and initialization val stfieldDef = theTyper.typedPos(pos)(VAL(stfieldSym) === rhs) -- cgit v1.2.3