[Mono-bugs] [Bug 583655] New: SRE does not emit defined type parameters

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 26 07:34:19 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=583655

http://bugzilla.novell.com/show_bug.cgi?id=583655#c0


           Summary: SRE does not emit defined type parameters
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: generics
        AssignedTo: rkumpera at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


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");



        var nested = tb.DefineNestedType ("N", TypeAttributes.NestedPublic);

        nested.DefineGenericParameters("T");



        var ctor = nested.DefineConstructor (MethodAttributes.Public,
CallingConventions.Standard, null);

        il_gen = ctor.GetILGenerator ();

        il_gen.Emit (OpCodes.Ret);



        MethodBuilder mb = tb.DefineMethod("F",

            MethodAttributes.Public, typeof(string), null);

        il_gen = mb.GetILGenerator ();

        il_gen.Emit (OpCodes.Newobj, ctor);

        il_gen.Emit (OpCodes.Ret);



        nested.CreateType ();

        tb.CreateType ();



        assembly.Save("bug-sre-test.exe");

    }

}



1. compile
2. run produced .exe
3. monodis bug-sre-test.exe | grep newobj

Mono result:

IL_0000:  newobj instance void class T/N::'.ctor'()

NET result

IL_0000:  newobj instance void class T/N<!T>::'.ctor'()

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list