[Mono-bugs] [Bug 616809] New: Object type returned is incorrect

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jun 23 13:59:00 EDT 2010


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

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


           Summary: Object type returned is incorrect
    Classification: Mono
           Product: Mono: Runtime
           Version: SVN
          Platform: 64bit
        OS/Version: RHEL 5
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: srfcanada at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64;
Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152)

returning an object type will return incorrect type information is the type is
used in a using statement. The following sample demonstrates that. by changing
it from using a using statement to using the type itself makes it work . We
noticed that using a type in a using statement causes a lot of strange side
effects but they all related to this sample.

Reproducible: Always

Steps to Reproduce:
public class testCase
{
using TestGeneric =
Drms.Server.DomainModel.DataContainers.Test.RealArrayParameterizationTests.GenericClass<double>;

 public class GenericClass<T>
      {

      }

      public abstract class AbstractClass1
      {
         private Type m_type;
         public AbstractClass1(Type objectType)
         {
            m_type = objectType;
            Console.WriteLine("passed in type: " + objectType.FullName);
         }

         public Type Type
         {
            get { return m_type; }
         }
      }


      public abstract class AbstractClass2 : AbstractClass1
      {
         public AbstractClass2()
            : base(typeof(TestGeneric))
         {

         }

      }


      public class TestClass : AbstractClass2
      {

      }

      [Test]
      public void testReturnType()
      {
         TestClass testClass = new TestClass();
         //this fails in mono
         Assert.AreEqual(typeof(GenericClass<double>), testClass.Type);
      }
}

-- 
Configure bugmail: http://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