summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc
diff options
context:
space:
mode:
authorGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-14 10:41:55 +0200
committerGrzegorz Kossakowski <grzegorz.kossakowski@gmail.com>2012-09-17 20:26:08 +0200
commit6854842cf88f020289b783983d13ebef4d7605f4 (patch)
treef0cbba527845335526250cac11371fc369b44319 /src/compiler/scala/tools/nsc
parent4ed7a60caf3648571de9a120e095f9cf3a0151c4 (diff)
downloadscala-6854842cf88f020289b783983d13ebef4d7605f4.tar.gz
scala-6854842cf88f020289b783983d13ebef4d7605f4.tar.bz2
scala-6854842cf88f020289b783983d13ebef4d7605f4.zip
Revert "Fixes SI-6236."
This reverts commit faa114e2fb6003031efa2cdd56a32a3c44aa71fb.
Diffstat (limited to 'src/compiler/scala/tools/nsc')
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala15
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala2
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)