[Mono-bugs] [Bug 594728] New: TypeBuilder::IsSubclassOf does not always work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 8 05:28:37 EDT 2010


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

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


           Summary: TypeBuilder::IsSubclassOf does not always work
    Classification: Mono
           Product: Mono: Runtime
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: rkumpera at novell.com
        ReportedBy: msafar at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Compile & Run

using System;

using System.Threading;

using System.Reflection;

using System.Reflection.Emit;



class C

{

    public static void Main ()

    {

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



        var tb_a = module.DefineType ("A", TypeAttributes.Public);



        var tb_b = module.DefineType ("B", TypeAttributes.Public);

        tb_b.SetParent (tb_a);

        tb_a.SetParent (typeof(Attribute));



        var r = tb_b.IsSubclassOf (tb_a);

        var r2 = tb_a.IsSubclassOf (tb_b);



        Console.WriteLine (r);

        Console.WriteLine (r2);

    }

}


Result:

False
False

Expected Result:

True
False

It's major because it causes exceptions all over SRE land as many argument
checks depend on it.

-- 
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