https://bugzilla.novell.com/show_bug.cgi?id=649233
https://bugzilla.novell.com/show_bug.cgi?id=649233#c0 Summary: stfld does not work with TypeBuilderOn* instances Classification: Mono Product: Mono: Runtime Version: SVN Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: misc AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- Compile & run using System; using System.Reflection; using System.Reflection.Emit; class Program { static void Main () { AssemblyName asmname = new AssemblyName (); asmname.Name = "sre"; AssemblyBuilder asmbuild = System.Threading.Thread.GetDomain ().DefineDynamicAssembly (asmname, AssemblyBuilderAccess.RunAndSave); ModuleBuilder modbuild = asmbuild.DefineDynamicModule ("modulename", "sre.exe"); TypeBuilder myType = modbuild.DefineType ("Sample", TypeAttributes.Public); string[] typeParamNames = { "TFirst" }; var tp = myType.DefineGenericParameters (typeParamNames); var nested = myType.DefineNestedType ("nested"); nested.DefineGenericParameters (typeParamNames); var field = myType.DefineField ("field", nested, FieldAttributes.Public); var m = myType.DefineMethod ("test", MethodAttributes.Public); m.SetParameters (myType); var ilgen = m.GetILGenerator (); ilgen.Emit (OpCodes.Ldarg_0); ilgen.Emit (OpCodes.Ldnull); ilgen.Emit (OpCodes.Stfld, TypeBuilder.GetField (myType.MakeGenericType (tp [0]), field)); ilgen.Emit (OpCodes.Ret); var baked = myType.CreateType (); nested.CreateType (); asmbuild.Save ("sre.exe"); return; } } Net result stfld class Sample/'nested'<!0> class Sample<!0>::'field' Mono stfld class Sample/'nested' class Sample<!0>::'field' -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
