diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-14 10:41:55 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-09-17 20:26:08 +0200 |
commit | 6854842cf88f020289b783983d13ebef4d7605f4 (patch) | |
tree | f0cbba527845335526250cac11371fc369b44319 /src | |
parent | 4ed7a60caf3648571de9a120e095f9cf3a0151c4 (diff) | |
download | scala-6854842cf88f020289b783983d13ebef4d7605f4.tar.gz scala-6854842cf88f020289b783983d13ebef4d7605f4.tar.bz2 scala-6854842cf88f020289b783983d13ebef4d7605f4.zip |
Revert "Fixes SI-6236."
This reverts commit faa114e2fb6003031efa2cdd56a32a3c44aa71fb.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 15 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index dcb90bef81..0bccd5fe0e 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -911,19 +911,8 @@ abstract class GenICode extends SubComponent { generatedType = toTypeKind(sym.accessed.info) val hostOwner = qual.tpe.typeSymbol.orElse(sym.owner) val hostClass = hostOwner.companionClass - val staticfield = hostClass.info.findMember(sym.accessed.name, NoFlags, NoFlags, false) orElse { - if (!currentRun.compiles(hostOwner)) { - // hostOwner was separately compiled -- the static field symbol needs to be recreated in hostClass - import Flags._ - debuglog("recreating sym.accessed.name: " + sym.accessed.name) - val objectfield = hostOwner.info.findMember(sym.accessed.name, NoFlags, NoFlags, false) - val staticfield = hostClass.newVariable(newTermName(sym.accessed.name.toString), tree.pos, STATIC | SYNTHETIC | FINAL) setInfo objectfield.tpe - staticfield.addAnnotation(definitions.StaticClass) - hostClass.info.decls enter staticfield - staticfield - } else NoSymbol - } - + val staticfield = hostClass.info.findMember(sym.accessed.name, NoFlags, NoFlags, false) + if (sym.isGetter) { ctx.bb.emit(LOAD_FIELD(staticfield, true) setHostClass hostClass, tree.pos) ctx diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 68a9510407..62a0c78c5c 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -594,7 +594,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL { // create a static field in the companion class for this @static field val stfieldSym = linkedClass.newVariable(newTermName(name), tree.pos, STATIC | SYNTHETIC | FINAL) setInfo sym.tpe stfieldSym.addAnnotation(StaticClass) - + val names = classNames.getOrElseUpdate(linkedClass, linkedClass.info.decls.collect { case sym if sym.name.isTermName => sym.name } toSet) |