diff options
author | Martin Odersky <odersky@gmail.com> | 2006-08-16 14:00:59 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-08-16 14:00:59 +0000 |
commit | 840911b8e30c0ef203a087ca4d91a24f148f3dd9 (patch) | |
tree | 48ff5d4a7276962ec71d09c15070458ae2136cd4 /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | |
parent | 49ee6e4ec40b8739e0f86c3ec23b7742e423f12f (diff) | |
download | scala-840911b8e30c0ef203a087ca4d91a24f148f3dd9.tar.gz scala-840911b8e30c0ef203a087ca4d91a24f148f3dd9.tar.bz2 scala-840911b8e30c0ef203a087ca4d91a24f148f3dd9.zip |
allowed access to provates between a class and ...
allowed access to provates between a class and its companion module
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 34f68f9f67..1c539f9400 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -71,11 +71,11 @@ abstract class ClassfileParser { this.in = new AbstractFileReader(file) if (root.isModule) { - this.clazz = root.linkedClass + this.clazz = root.linkedClassOfModule this.staticModule = root } else { this.clazz = root - this.staticModule = root.linkedModule + this.staticModule = root.linkedModuleOfClass } this.isScala = false this.hasMeta = false @@ -181,10 +181,10 @@ abstract class ClassfileParser { in.buf(start) != CONSTANT_METHODREF && in.buf(start) != CONSTANT_INTFMETHODREF) errorBadTag(start) val cls = getClassSymbol(in.getChar(start + 1)) - val Pair(name, tpe) = getNameAndType(in.getChar(start + 3), cls); - f = ((if (static) cls.linkedModule.moduleClass else cls) - .info.decl(name).suchThat(s => s.tpe =:= tpe)); - assert(f != NoSymbol, "Could not find symbol for " + name + ": " + tpe + " in " + cls); + val Pair(name, tpe) = getNameAndType(in.getChar(start + 3), cls) + val owner = if (static) cls.linkedClassOfClass else cls + f = owner.info.decl(name).suchThat(.tpe.=:=(tpe)) + assert(f != NoSymbol, "Could not find symbol for " + name + ": " + tpe + " in " + owner) values(index) = f } f @@ -524,7 +524,7 @@ abstract class ClassfileParser { def parseAttribute(): unit = { val attrName = pool.getName(in.nextChar) val attrLen = in.nextInt - val oldpb = in.bp; + val oldpb = in.bp attrName match { case nme.SignatureATTR => if (global.settings.Xgenerics.value) { @@ -554,7 +554,7 @@ abstract class ClassfileParser { if (!isScala) parseInnerClasses() else in.skip(attrLen) case nme.ScalaSignatureATTR => unpickler.unpickle(in.buf, in.bp, clazz, staticModule, in.file.toString()) - in.skip(attrLen); + in.skip(attrLen) this.isScala = true case nme.JacoMetaATTR => val meta = pool.getName(in.nextChar).toString().trim() @@ -599,7 +599,7 @@ abstract class ClassfileParser { case ENUM_TAG => val t = pool.getType(index) val n = pool.getName(in.nextChar) - val s = t.symbol.linkedModule.info.decls.lookup(n) + val s = t.symbol.linkedModuleOfClass.info.decls.lookup(n) //assert (s != NoSymbol, "while processing " + in.file + ": " + t + "." + n + ": " + t.decls) assert(s != NoSymbol, t) // avoid string concatenation! Constant(s) |