[Mono-bugs] [Bug 349194] New: Type. IsAssignableFrom fails for some dynamically emitted types

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 17 07:46:15 EST 2007


https://bugzilla.novell.com/show_bug.cgi?id=349194


           Summary: Type.IsAssignableFrom fails for some dynamically emitted
                    types
           Product: Mono: Class Libraries
           Version: SVN
          Platform: i586
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: jbevain at novell.com
         QAContact: mono-bugs at ximian.com
                CC: rodrigobamboo at gmail.com
          Found By: ---


Repro:

--
using System;
using System.Reflection;
using System.Reflection.Emit;

namespace repro
{
        public interface IFoo
        {
        }

        public class BaseType : IFoo {
        }

        class Program
        {

                static void Main(string[] args)
                {
                        AssemblyBuilder asm =
AppDomain.CurrentDomain.DefineDynamicAssembly(new AssemblyName("Foo"),
AssemblyBuilderAccess.Run);

                        ModuleBuilder module =
asm.DefineDynamicModule("Foo.exe");

                        TypeBuilder tb = module.DefineType("ConcreteFoo",
TypeAttributes.Public, typeof(BaseType));

                        Type t = tb.CreateType();
                        Console.WriteLine(typeof(IFoo).IsAssignableFrom(t));
                }
        }
}
--

It prints False while it should print True.


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


More information about the mono-bugs mailing list