http://bugzilla.novell.com/show_bug.cgi?id=587106
http://bugzilla.novell.com/show_bug.cgi?id=587106#c0 Summary: TypeBuilder.GetMethod throws unexpectedly Classification: Mono Product: Mono: Runtime Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: generics AssignedTo: [email protected] ReportedBy: [email protected] QAContact: [email protected] Found By: --- Blocker: --- compile & run using System; using System.Threading; using System.Reflection; using System.Reflection.Emit; class C { public static void Main () { TypeBuilder tb; ILGenerator il_gen; AssemblyName assemblyName = new AssemblyName (); assemblyName.Name = "MonoTests.System.Reflection.Emit.ILGeneratorTest"; AssemblyBuilder assembly = Thread.GetDomain ().DefineDynamicAssembly ( assemblyName, AssemblyBuilderAccess.RunAndSave); ModuleBuilder module = assembly.DefineDynamicModule("bug-sre-test.exe"); tb = module.DefineType ("T", TypeAttributes.Public); tb.DefineGenericParameters("T"); MethodBuilder mb = tb.DefineMethod("F", MethodAttributes.Public, typeof(string), null); il_gen = mb.GetILGenerator (); il_gen.Emit (OpCodes.Ret); TypeBuilder.GetMethod (tb, mb); } } Unhandled Exception: System.InvalidOperationException: can only be called in generic type at System.Type.GetMethod (System.Reflection.MethodInfo fromNoninstanciated) [0x00000] in <filename unknown>:0 at System.Reflection.Emit.TypeBuilder.GetMethod (System.Type type, System.Reflection.MethodInfo method) [0x00000] in <filename unknown>:0 at C.Main () [0x00000] in <filename unknown>:0 -- Configure bugmail: http://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
