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: [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 ()

    {

        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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to