private void EmitConstructorBody(MethodReference targetMethod) { var baseCtor = AssemblyRegistry.GetConstructor(Assembly, DeclaringType.BaseType); Ldarg(0); Call(methodDefinition.DeclaringType, baseCtor); if (targetMethod.HasThis) { AddArgument(targetMethod.DeclaringType, "$this"); var thisField = new FieldDefinition("$this", FieldAttributes.Private, targetMethod.DeclaringType); DeclaringType.AddField(thisField); Ldarg(0); Ldarg(1); Stfld(thisField); } Ret(); }