diff options
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. |