args[i] = cast(gen.Ident(params1[i]), symparams[i].type());
args[i] = cast(gen.Ident(params1[i]), symparams[i].type().erasure());
    public void addBridge(Symbol sym, Symbol sym1) {	Type bridgeType = sym1.type().erasure();	// create bridge symbol and add to bridgeSyms(sym)	// or return if bridge with required type already exists for sym.	SymSet bridgesOfSym = (SymSet) bridgeSyms.get(sym);	if (bridgesOfSym == null) bridgesOfSym = SymSet.EMPTY;	Symbol[] brs = bridgesOfSym.toArray();	for (int i = 0; i < brs.length; i++) {	    if (brs[i].type().isSameAs(bridgeType)) return;	}	Symbol bridgeSym = sym.cloneSymbol();	bridgeSym.flags |= (SYNTHETIC | BRIDGE);	bridgeSym.flags &= ~JAVA;	bridgesOfSym = bridgesOfSym.incl(bridgeSym);	bridgeSyms.put(sym, bridgesOfSym);	// check that there is no overloaded symbol with same erasure as bridge	Symbol overSym = sym.owner().members().lookup(sym.name);	switch (overSym.type()) {	case OverloadedType(Symbol[] alts, Type[] alttypes):	    for (int i = 0; i < alts.length; i++) {		if (sym != alts[i] && bridgeType.isSameAs(alttypes[i].erasure())) {		    unit.error(sym.pos, "overlapping overloaded alternatives; " +			       "overridden " + sym1 + sym1.locationString() +			       " has same erasure as " + alts[i] +			       alttypes[i] + alts[i].locationString());		}	    }	}	switch (bridgeType) {	case MethodType(Symbol[] params, Type restp):	    // assign to bridge symbol its bridge type	    // where owner of all parameters is bridge symbol itself.	    Symbol[] params1 = new Symbol[params.length];	    for (int i = 0; i < params.length; i++) {		params1[i] = params[i].cloneSymbol();		params1[i].setOwner(bridgeSym);	    }	    bridgeSym.setType(Type.MethodType(params1, restp));	    // create bridge definition	    Type symtype = sym.type().erasure();	    switch (symtype) {	    case MethodType(Symbol[] symparams, Type symrestp):		assert params1.length == symparams.length;		Tree[] args = new Tree[params1.length];		for (int i = 0; i < args.length; i++) {		    args[i] = cast(gen.Ident(params1[i]), symparams[i].type());		}		Tree fwd = make.Apply(sym.pos, gen.Ident(sym).setType(symtype), args)		    .setType(symrestp);		bridges.append(gen.DefDef(bridgeSym, coerce(fwd, restp)));		return;	    }	}	throw Debug.abort("bad bridge types " + bridgeType + "," + sym.type().erasure());    }