diff options
author | Martin Odersky <odersky@gmail.com> | 2009-08-11 07:22:25 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-08-11 07:22:25 +0000 |
commit | 60533e82c898d0ead48850fa877620202337c770 (patch) | |
tree | 00454f322670f277b59085a095b9a0b1bf32df33 /src | |
parent | 62104980be73cbf66294945ac048386e3cf60f1b (diff) | |
download | scala-60533e82c898d0ead48850fa877620202337c770.tar.gz scala-60533e82c898d0ead48850fa877620202337c770.tar.bz2 scala-60533e82c898d0ead48850fa877620202337c770.zip |
Fix of #1722
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala index f2aa736656..87bf879980 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/UnPickler.scala @@ -182,10 +182,19 @@ abstract class UnPickler { case EXTref | EXTMODCLASSref => val name = readNameRef() val owner = if (readIndex == end) definitions.RootClass else readSymbolRef() - sym = if (name.toTermName == nme.ROOT) definitions.RootClass - else if (name == nme.ROOTPKG) definitions.RootPackage - else if (tag == EXTref) owner.info.decl(name) - else owner.info.decl(name).moduleClass + def fromName(name: Name) = + if (name.toTermName == nme.ROOT) definitions.RootClass + else if (name == nme.ROOTPKG) definitions.RootPackage + else if (tag == EXTref) owner.info.decl(name) + else owner.info.decl(name).moduleClass + sym = fromName(name) + // If sym not found try with expanded name. + // This can happen if references to private symbols are + // read from outside; for instance when checking the children of a class + // (see t1722) + if (sym == NoSymbol) { + sym = fromName(owner.expandedName(name)) + } // If the owner is overloaded (i.e. a method), it's not possible to select the // right member => return NoSymbol. This can only happen when unpickling a tree. |