throw new ApplicationError("Dunno what to do: " + tree.getClass());
throw Debug.abort("Dunno what to do", tree);
    private Item gen0(Tree tree, MSILType toType) {	Symbol sym = tree.hasSymbol() ? tree.symbol() : null;	Item item = null;	switch (tree) {	case Empty:	    return items.VoidItem();	case Block(Tree[] stats, Tree value):            boolean tmpLastExpr = lastExpr; lastExpr = false;            for (int i = 0; i < stats.length; i++) {                drop(gen(stats[i], MSILType.VOID));            }            lastExpr = tmpLastExpr;            return gen(value, toType);	case ValDef(_, Name name, Tree tpe, Tree rhs):	    LocalBuilder local = code.DeclareLocal(tc.getType(sym));	    //local.SetLocalSymInfo(name.toString());	    local.SetLocalSymInfo(tree.symbol().name.toString());	    locals.put(sym, local);	    if (rhs == Tree.Empty)		return items.VoidItem();	    MSILType type = msilType(tpe.type);	    genLoad(rhs, type);	    return check(store(items.LocalItem(local)));	case Ident(_):	    if (sym.isModule()) {		FieldInfo field = tc.getModuleField(sym);		// force the loading of the module 		item = coerce(load(items.StaticItem(field)), toType);	    } else {		MSILType type = msilType(sym.info());		Integer slot = (Integer) params.get(sym);		if (slot != null) {		    item = items.ArgItem(type, slot.intValue());		} else {		    LocalBuilder local = (LocalBuilder) locals.get(sym);		    if (local != null)			item = items.LocalItem(local);		    else {			assert sym.isStatic() : Debug.show(sym);			//global.fail("Ident = " + Debug.show(sym));			FieldInfo field = tc.getField(sym);			assert field != null : Debug.show(sym);			if (field.IsLiteral()) {			    assert field.FieldType.IsEnum()				&& field.getValue() != null				: field.toString();			    return coerce(mkLiteral(msilType(field.FieldType),						    field.getValue()),					  toType);			}			return coerce(items.StaticItem(field), toType);		    }		}	    }	    return coerce(item, toType);	case Select(Tree qualifier, _):	    if (sym.isModule()) {		assert !sym.isJava() : "Cannot treat Java class '" +		    Debug.show(sym) + "' as value.";		//System.out.println("gen2.Select: object " + Debug.show(qualifier)		//		   + " . " + Debug.show(sym));		return coerce(load(items.StaticItem(tc.getModuleField(sym))), toType);	    }	    assert !sym.isStatic() :Debug.show(sym);	    item = items.SelectItem(genLoad(qualifier, msilType(qualifier)),				    tc.getField(sym));	    return coerce(item, toType);	case Apply(Tree fun, Tree[] args):	    //System.out.println("gen2.Apply: tree.type = " + msilType(tree.type));	    return coerce(check(genApply(fun, args, msilType(tree.type))), toType);	case Assign(Tree lhs, Tree rhs):	    boolean tmpLastExpr = lastExpr; lastExpr = false;	    MSILType type = msilType(lhs.type);	    Item var = gen(lhs, type);	    genLoad(rhs, type);	    lastExpr = tmpLastExpr;	    return check(store(var));	case New(Tree init):	    switch (init) {	    case Apply(Tree fun, Tree[] args):		ConstructorInfo ctor = (ConstructorInfo) tc.getMethod(fun.symbol());		loadArgs(args, ctor.GetParameters());		code.Emit(OpCodes.Newobj, ctor);		return coerce(items.StackItem(msilType(ctor.DeclaringType)), toType);	    default:		throw Debug.abort("Incorrect tree", init);	    }	case This(_):	    //return items.SelfItem(tc.getType(currentClass));	    return coerce(items.SelfItem(tc.getType(sym)), toType);	case Super(_, _):// 	    Item retItem = items.SelfItem(tc.getType(currentClass));// 	    return retItem;	    return coerce(items.SelfItem(tc.getType(sym)), toType);	case Literal(AConstant value):	    if (toType == MSILType.VOID)		return items.VoidItem();	    return coerce(items.LiteralItem(value), toType);	case If(Tree cond, Tree thenp, Tree elsep):	    item = genIf(cond, thenp, elsep, toType);	    return check(item);	case LabelDef(_, _ /*Ident[] params*/, Tree rhs):	    Label l = code.DefineLabel();	    code.MarkLabel(l);	    sym2label.put(sym, l);	    return gen(rhs, toType);	case Switch(Tree test, int[] tags, Tree[] bodies, Tree otherwise):	    LocalBuilder testLoc = code.DeclareLocal(tc.INT);	    Item loc = items.LocalItem(testLoc);	    boolean tmpLastExpr = lastExpr; lastExpr = false;	    genLoad(test, MSILType.I4);	    store(loc);	    lastExpr = tmpLastExpr;	    Label exit = code.DefineLabel();	    Label nextCase = code.DefineLabel();	    assert tags.length == bodies.length;	    for (int i = 0; i < tags.length; i++) {		load(loc);		loadI4(tags[i]);		code.Emit(OpCodes.Bne_Un, nextCase);		genLoad(bodies[i], toType);// 		if (lastExpr)// 		    code.Emit(OpCodes.Ret);// 		else		if (willReturn)		    code.Emit(OpCodes.Br, exit);		code.MarkLabel(nextCase);		nextCase = code.DefineLabel();	    }	    Item i = genLoad(otherwise, toType);	    code.MarkLabel(exit);	    return i;	default:	    throw new ApplicationError("Dunno what to do: " + tree.getClass());	}	    } //gen()