code.setPosition(Position.line(rhs.pos));
if (global.args.debuginfo.value) code.setPosition(Position.line(rhs.pos));
    private void genDef(Symbol sym, ValDef[] parameters, Tree rhs, MSILType toType) {	MethodBase method = tc.getMethod(sym);	params.clear();	locals.clear();	int argOffset = method.IsStatic() ? 0 : 1;	for (int i = 0; i < parameters.length; i++) {	    params.put(parameters[i].symbol(), new Integer(i + argOffset));	}	if (method.IsConstructor()) {	    ConstructorInfo ctor = (ConstructorInfo) method;	    code = ((ConstructorBuilder)ctor).GetILGenerator();	    code.setPosition(Position.line(rhs.pos));	    if (sym.owner().isModuleClass()		&& sym.owner().owner().isPackageClass()) {		Tree[] cstats = null;		switch (rhs) {		case Block(Tree[] stats, Tree value):		    TreeList stms = new TreeList();		    for (int i = 0; i < stats.length; i++) {			switch (stats[i]) {			case Block(Tree[] stats2, Tree value2):			    stms.append(stats2);			    stms.append(value2);			    break;			default:			    stms.append(stats[i]);			}		    }		    switch (value) {		    case Block(Tree[] stats2, Tree value2):			stms.append(stats2);			stms.append(value2);			break;		    }		    cstats = stms.toArray();		    break;		default:		    cstats = new Tree[]{rhs};		}		// emit the call to the superconstructor		drop(gen(cstats[0], MSILType.VOID));		code.Emit(OpCodes.Ret); // conclude the instance constructor		ConstructorBuilder cctor = ((TypeBuilder)(method.DeclaringType)).		    DefineConstructor((short)(MethodAttributes.Static					      | MethodAttributes.Public),				      CallingConventions.Standard,				      Type.EmptyTypes);		currentMethod = cctor;		code = cctor.GetILGenerator();		code.setPosition(Position.line(sym.owner().pos));		// initialize the static module reference		code.Emit(OpCodes.Newobj, ctor);		code.Emit(OpCodes.Stsfld, tc.getModuleField(currentClass));		for (int i = 1; i < cstats.length; i++) {		    drop(gen(cstats[i], MSILType.VOID));		}		code.Emit(OpCodes.Ret); // conclude the static constructor	    } else {		drop(gen(rhs, MSILType.VOID));		code.Emit(OpCodes.Ret);	    }	} else if (!method.IsAbstract()) {	    lastExpr = true;	    code = ((MethodBuilder)method).GetILGenerator();	    code.setPosition(Position.line(rhs.pos));	    Item item = gen(rhs, toType);	    if (returnsVoid(method))		drop(item);	    else		coerce(load(item), toType); // FIXME: coerce???	    code.Emit(OpCodes.Ret);	    if (currentClass.isModuleClass()) {		MethodBuilder staticMethod = tc.getStaticObjectMethod(sym);		if (staticMethod != null) {		    code = staticMethod.GetILGenerator();		    code.setPosition(Position.line(sym.pos));		    code.Emit(OpCodes.Ldsfld, tc.getModuleField(currentClass));		    for (int i = 0; i < parameters.length; i++)			emitLdarg(i);		    code.Emit(OpCodes.Call, (MethodInfo)method);		    code.Emit(OpCodes.Ret);		}	    }	}	lastExpr = false;	code = null;    } // genDef();