if (tag == EXTref) sym = sym.module();
    Symbol getSymbol(int n) {	if (entries[n] == null) {	    int savedBp = bp;	    bp = index[n];	    int tag = bytes[bp++];	    int end = readNat() + bp;	    Symbol sym;	    Symbol owner;	    switch (tag) {	    case NONEsym:		entries[n] = sym = Symbol.NONE;		break;	    case EXTref:	    case EXTMODCLASSref:		Name name = readNameRef();		if (bp == end) {		    owner = Global.instance.definitions.ROOT_CLASS;		} else {		    assert bp < end;		    owner = readSymbolRef();		}		if (name == Names.ROOT && owner == Symbol.NONE) {		    sym = Global.instance.definitions.ROOT_CLASS;		} else {		    sym = owner.info().lookup(name);		    if (tag == EXTMODCLASSref) {			/*			if (sym.kind == VAL)			    switch (sym.type()) {			    case OverloadedType(Symbol[] alts, _):				for (int i = 0; i < alts.length; i++)				    if (alts[i].isModule()) sym = alts[i];			    }			*/			assert sym.isModule();			sym = sym.moduleClass();		    }		}		entries[n] = sym;		if (sym.kind == NONE) {		    if (global.debug)			global.log(owner.info().members().toString());		    throw new BadSignature(this,			"reference " + decode(name) + " of " + owner + 			" refers to nonexisting symbol.");		}		break;	    default:		assert isSymbolEntry(n) : n;		Name name = readNameRef();		if (global.debug) 		    global.log("reading " + name + " at " + n);		owner = readSymbolRef();		if (entries[n] == null) {		    int flags = readNat();		    int inforef = readNat();		    switch (tag) {		    case TYPEsym:			entries[n] = sym = new AbsTypeSymbol(			    Position.NOPOS, name, owner, flags);			sym.setFirstInfo(getType(inforef));			sym.setLoBound(readTypeRef());			break;					    case ALIASsym:			entries[n] = sym = new AliasTypeSymbol(			    Position.NOPOS, name, owner, flags);			sym.setFirstInfo(getType(inforef));			Symbol constr = readSymbolRef(); 			break;		    case CLASSsym:			entries[n] = sym = new ClassSymbol(			    Position.NOPOS, name, owner, flags);			Symbol clr = ((flags & MODUL) == 0) ? classroot			    : moduleroot.moduleClass();			if (name == clr.name && owner == clr.owner()) {			    if (global.debug) global.log("overwriting " + clr);			    sym.copyTo(clr);			    entries[n] = sym = clr;			}			sym.setFirstInfo(getType(inforef));			sym.setTypeOfThis(readTypeRef());			Symbol constr = readSymbolRef();			assert constr == sym.allConstructors();			Symbol[] alts = constr.alternativeSymbols();			for (int i = 0; i < alts.length; i++)			    ((TermSymbol)alts[i]).makeConstructor((ClassSymbol)sym);			break;				    case VALsym:			if (bp < end) {			    Symbol tsym = readSymbolRef();			    if (name == Names.CONSTRUCTOR) {				entries[n] = sym = tsym.allConstructors();				sym.flags = flags;			    } else {				assert (flags & MODUL) != 0 : name;				entries[n] = sym = new TermSymbol(				    Position.NOPOS, name, owner, flags)				    .makeModule((ClassSymbol) tsym);			    }			} else {			    entries[n] = sym = new TermSymbol(				Position.NOPOS, name, owner, flags);			}			if (name == moduleroot.name && owner == moduleroot.owner()) {			    if (global.debug)				global.log("overwriting " + moduleroot);			    sym.copyTo(moduleroot);			    entries[n] = sym = moduleroot;			}			Type tp = getType(inforef);			sym.setFirstInfo(tp.setOwner(sym));			break;		    default:			throw new BadSignature(this);		    }		    enterSymbol(sym);		}	    }	    bp = savedBp;	}	return (Symbol) entries[n];    }