if (moduleField != null) {
if (moduleField != null && moduleField.DeclaringType.DeclaringType == null) {
    void genDef(Symbol sym, ValDef[] parameters, Tree rhs, MSILType toType) {	MethodBase method = tc.getMethod(sym);	//log("genDef: " + method.getSignature());	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) {	    //log("genDef: " + method);	    ConstructorInfo ctor = (ConstructorInfo) method;	    code = ((ConstructorBuilder)ctor).GetILGenerator();	    FieldInfo moduleField = tc.getModuleField(currentClass);	    if (moduleField != null) {// 		log("genDef: initializing " + moduleField +// 		    " for class " + method.DeclaringType);		// emit the call to the superconstructor		switch (rhs) {		case Block(Tree[] stats):		    // this is the call to the super constructor		    drop(gen(stats[0], MSILType.VOID));		    break;		default:		    drop(gen(rhs, MSILType.VOID));		}		ConstructorBuilder cctor = ((TypeBuilder)(method.DeclaringType)).		    DefineConstructor((short)(MethodAttributes.Static					      | MethodAttributes.Public),				      CallingConventions.Standard,				      Type.EmptyTypes);		currentMethod = cctor;		ILGenerator ctorCode = code;		code = cctor.GetILGenerator();		// initialize the static module reference		code.Emit(OpCodes.Newobj, ctor);		code.Emit(OpCodes.Stsfld, moduleField);		switch (rhs) {		case Block(Tree[] stats):		    int n = stats.length;		    assert n > 0;		    for (int i = 1; i < n; i++)			drop(gen(stats[i], MSILType.VOID));		    break;		}		code.Emit(OpCodes.Ret);		code = ctorCode;	    } else		drop(gen(rhs, MSILType.VOID));	    code.Emit(OpCodes.Ret);	} else if (!method.IsAbstract) {	    lastStatement = true;	    code = ((MethodBuilder)method).GetILGenerator();	    Item item = gen(rhs, toType);	    if (returnsVoid(method))		drop(item);	    else		coerce(load(item), toType); // coerce???	    code.Emit(OpCodes.Ret);	}	lastStatement = false;	code = null;    } // genDef();