Skip to content

Instantly share code, notes, and snippets.

@kumpera
Created July 27, 2010 18:41
Show Gist options
  • Save kumpera/492652 to your computer and use it in GitHub Desktop.
Save kumpera/492652 to your computer and use it in GitHub Desktop.
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventLogger.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventLogger.cs
index f561b9e..f0ef5d2 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventLogger.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/EventLogger.cs
@@ -125,10 +125,14 @@ namespace MonoTests.System.Windows.Forms
TypeBuilder logType = module.DefineType ("Logger");
FieldBuilder logField = logType.DefineField ("log", ListType, FieldAttributes.Public);
- ConstructorBuilder logCtor = logType.DefineConstructor (MethodAttributes.Public, CallingConventions.HasThis, new Type [] {ListType, typeof (object)});
+ ConstructorBuilder logCtor = logType.DefineConstructor (MethodAttributes.Public, CallingConventions.HasThis, new Type [] {ListType, itemType});
logCtor.DefineParameter (1, ParameterAttributes.None, "test");
logCtor.DefineParameter (2, ParameterAttributes.None, "obj");
ILGenerator logIL = logCtor.GetILGenerator ();
+
+ logIL.Emit (OpCodes.Ldarg_0);
+ logIL.Emit (OpCodes.Call, typeof (object).GetConstructor (Type.EmptyTypes));
+
logIL.Emit (OpCodes.Ldarg_0);
logIL.Emit (OpCodes.Ldarg_1);
logIL.Emit (OpCodes.Stfld, logField);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment