From 6b9e1a0747159128da1e84795c1be6698e16ee43 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Fri, 14 Sep 2012 10:45:43 +0200 Subject: Revert "Fixes SI-6189." This reverts commit 5a8dfad583b825158cf0abdae5d73a4a7f8cd997. Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala --- src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 10 +++------- src/compiler/scala/tools/nsc/transform/CleanUp.scala | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 0bccd5fe0e..697c2bf23b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -900,17 +900,13 @@ abstract class GenICode extends SubComponent { case app @ Apply(fun @ Select(qual, _), args) if !ctx.method.symbol.isStaticConstructor - && fun.symbol.isAccessor && fun.symbol.accessed.hasStaticAnnotation - && qual.tpe.typeSymbol.orElse(fun.symbol.owner).companionClass != NoSymbol => + && fun.symbol.isAccessor && fun.symbol.accessed.hasStaticAnnotation => // bypass the accessor to the companion object and load the static field directly - // this bypass is not done: - // - if the static intializer for the static field itself - // - if there is no companion class of the object owner - this happens in the REPL + // the only place were this bypass is not done, is the static intializer for the static field itself def genLoadApply5 = { val sym = fun.symbol generatedType = toTypeKind(sym.accessed.info) - val hostOwner = qual.tpe.typeSymbol.orElse(sym.owner) - val hostClass = hostOwner.companionClass + val hostClass = qual.tpe.typeSymbol.orElse(sym.owner).companionClass val staticfield = hostClass.info.findMember(sym.accessed.name, NoFlags, NoFlags, false) if (sym.isGetter) { diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index 62a0c78c5c..a705e85310 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -783,7 +783,6 @@ abstract class CleanUp extends Transform with ast.TreeDSL { // add field definition to new defs newStaticMembers append stfieldDef newStaticInits append stfieldInit - case _ => // ignore @static on other members } } -- cgit v1.2.3