Symbol bcSym = baseTypes[bcIndex].symbol();
final Symbol bcSym = baseTypes[bcIndex].symbol();
    protected Template expandMixins(Template tree, Symbol owner) {        Type templType = owner.info();        List/*<Tree>*/ newBody = new ArrayList();	Scope newMembers = new Scope();        Map mixedInSymbols/*<Symbol,Symbol>*/ = new HashMap();        Symbol newTemplSymbol = tree.symbol().cloneSymbol();        // Start by copying the statement sequence.        Tree[] body = tree.body;        for (int i = 0; i < body.length; ++i) {            Tree stat = body[i];            newBody.add(transform(stat));            if (stat.definesSymbol()) {		Symbol sym = stat.symbol();		newMembers.enterOrOverload(sym);            }        }        Type[] baseTypes = owner.parents();        global.log("baseTypes for " + Debug.show(owner)                   + " = <" + ArrayApply.toString(baseTypes) + ">");        // Then go over the mixins and mix them in.        for (int bcIndex = tree.parents.length - 1; bcIndex > 0; --bcIndex) {            Tree bc = tree.parents[bcIndex];            Symbol bcSym = baseTypes[bcIndex].symbol();            if ((bcSym.flags & Modifiers.INTERFACE) != 0)                continue;            assert classDefs.containsKey(bcSym) : bcSym;            ClassDef bcDef = (ClassDef)classDefs.get(bcSym);            Map symbolMap/*<Symbol,Symbol>*/ = new HashMap();            // Create substitution for mixin's type parameters.            Object[] ts = typeSubst(baseTypes[bcIndex]);            assert ts.length == 2;            final Symbol[] tpFormals = (Symbol[])ts[0];            final Type[] tpActuals = (Type[])ts[1];            assert tpFormals.length == tpActuals.length;            Type.Map typeMap = new Type.Map() {                    public Type apply(Type t) {                        return t.subst(tpFormals, tpActuals);                    }                };            // Create private fields for mixin's value parameters.            Tree[][] actuals = getArgsSection(bc);            assert bcDef.vparams.length == actuals.length;            for (int s = 0; s < bcDef.vparams.length; ++s) {                ValDef[] sectionF = bcDef.vparams[s];                Tree[] sectionA = actuals[s];                assert sectionF.length == sectionA.length;                for (int p = 0; p < sectionF.length; ++p) {                    // We do not need to copy the actual parameters,                    // since they are removed from their original                    // location anyway.                    ValDef formal = sectionF[p];                    Tree actual = sectionA[p];                    Symbol memberSymbol =                        renameSymbol(symbolMap, formal.symbol());                    memberSymbol.setOwner(owner);                    Type memberType = typeMap.apply(formal.tpe.type());                    memberSymbol.updateInfo(memberType);                    Tree memberDef = gen.ValDef(memberSymbol, actual);                    newBody.add(memberDef);                }            }            Template mixin = getMixinExpandedTemplate(bcDef.impl, bcSym);            Type bcType = mixin.type();            Tree[] mixinBody = mixin.body;            Set/*<Tree>*/ leftOutMembers = new HashSet();            // Pass 1: compute members to rename.            for (int m = 0; m < mixinBody.length; ++m) {                Tree member = mixinBody[m];                if (!member.definesSymbol())                    continue;                Symbol memSym = member.symbol();                Name memName = memSym.name;                // Check if we have to import this member. To do this,                // we lookup the member both in the template and in                // the mixin, and if the result is the same, we import                // the member (otherwise it means it's shadowed).                Symbol memSymT = templType.lookupNonPrivate(memName);                Symbol memSymM = bcType.lookupNonPrivate(memName);                if (memSymT != memSymM) {                    if ((memSym.flags & Modifiers.DEFERRED) != 0)                        leftOutMembers.add(member);                    else                        renameSymbol(symbolMap, memSym);                }            }            // Pass 2: copy members            treeCopier.pushThisTypeSubst(bcSym, owner);            for (int m = 0; m < mixinBody.length; ++m) {                Tree member = mixinBody[m];                if (leftOutMembers.contains(member))                    continue;                treeCopier.pushSymbolSubst(symbolMap);                treeCopier.pushTypeSubst(tpFormals, tpActuals);                Tree newMember = treeCopier.copy(member);                treeCopier.popTypeSubst();                treeCopier.popSymbolSubst();                newBody.add(newMember);                if (newMember.definesSymbol()) {		    Symbol sym = newMember.symbol();                    sym.setOwner(owner);                    newMembers.enterOrOverload(sym);                    mixedInSymbols.put(member.symbol(), newMember.symbol());		}            }            treeCopier.popThisTypeSubst();        }	// Modify mixin base classes to refer to interfaces instead of	// real classes.	Type[] newBaseTypes = new Type[baseTypes.length];	Tree[] newBaseClasses = new Tree[tree.parents.length];        newBaseTypes[0] = baseTypes[0];        newBaseClasses[0] = tree.parents[0];	for (int i = 1; i < baseTypes.length; ++i) {	    switch (baseTypes[i]) {	    case TypeRef(Type pre, Symbol sym, Type[] args): {		if (!Modifiers.Helper.isInterface(sym.flags))                    sym = addInterfaces.getInterfaceSymbol(sym);                newBaseClasses[i] =                    gen.mkParentConstr(tree.pos, new Type.TypeRef(pre, sym, args));		newBaseTypes[i] = new Type.TypeRef(pre, sym, args);	    } break;	    default:		throw global.fail("invalid base class type", baseTypes[i]);	    }	}        // Use correct symbols for mixed-in members.        SymbolFixer symbolFixer = new SymbolFixer(global, mixedInSymbols);        Tree[] fixedBody =            symbolFixer.transform((Tree[])newBody.toArray(new Tree[newBody.size()]));        Template newTree = make.Template(tree.pos, newBaseClasses, fixedBody);        newTree.setSymbol(newTemplSymbol);	newTree.setType(Type.compoundType(newBaseTypes, newMembers, owner));        return newTree;    }