diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-04-12 17:12:29 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2011-04-12 17:12:29 +0000 |
commit | a3b106bf60ca020fad8eb502f598bff390a7b49b (patch) | |
tree | 43eccf4b233c21810c8f7703b6ef9000d23b39cb | |
parent | afd1e7d29329523dd90cc95cbbacdabed15f28b3 (diff) | |
download | scala-a3b106bf60ca020fad8eb502f598bff390a7b49b.tar.gz scala-a3b106bf60ca020fad8eb502f598bff390a7b49b.tar.bz2 scala-a3b106bf60ca020fad8eb502f598bff390a7b49b.zip |
closes #4426.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 5 | ||||
-rw-r--r-- | test/files/run/t4426.scala | 24 |
2 files changed, 26 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 49f5907245..d98281aaa4 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -675,7 +675,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { def bitmapOperation[T](field: Symbol, transientCase: => T, privateCase: => T, rest: => T): T = if (field.accessed.hasAnnotation(TransientAttr)) transientCase - else if (field.hasFlag(PRIVATE)) + else if (field.hasFlag(PRIVATE) || field.hasFlag(notPRIVATE)) privateCase else rest @@ -686,7 +686,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { * Similarly fields in the checkinit mode use private bitmaps. */ def localBitmapField(field: Symbol) = - field.accessed.hasAnnotation(TransientAttr) || field.hasFlag(PRIVATE) || checkinitField(field) + field.accessed.hasAnnotation(TransientAttr) || field.hasFlag(PRIVATE | notPRIVATE) || checkinitField(field) /** * Return the bitmap field for 'offset'. Depending on the hierarchy it is possible to reuse @@ -705,7 +705,6 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { val bitmapName = if (checkinitField) bitmapCheckinitName else bitmapLazyName def createBitmap: Symbol = { - val sym = clazz0.newVariable(clazz0.pos, bitmapName).setInfo(IntClass.tpe) atPhase(currentRun.typerPhase) { sym addAnnotation AnnotationInfo(VolatileAttr.tpe, Nil, Nil) diff --git a/test/files/run/t4426.scala b/test/files/run/t4426.scala new file mode 100644 index 0000000000..1cbd42da25 --- /dev/null +++ b/test/files/run/t4426.scala @@ -0,0 +1,24 @@ +import scala.tools.nsc._ + +object Test { + val x = { + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + + object cc extends Global(settings) { + object dummy + + override def computePluginPhases() = { + super.computePluginPhases() + assert(dummy ne null, "Dummy not initialized") + } + } + new cc.Run + () + } + + def main(args: Array[String]): Unit = { + + } +} + |