[Mono-bugs] [Bug 633671] New: ReflectedType and DeclaringType on MemberInfo returns incorrect information

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 23 09:42:37 EDT 2010



           Summary: ReflectedType and DeclaringType on MemberInfo returns
                    incorrect information
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: philip.peitsch at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:
Gecko/20100812 Ubuntu/10.10 (maverick) Firefox/3.6.8

I have a test framework that makes heavy use of reflection to allow building of
automated test data.  I have found the attached code that seems to have
somewhat inconsistent behaviour running under Mono 2.6.7 on Ubuntu 10.10 alpha.

The attached code produces the following output on my machine:
Child1 MonoReflectionTest.ClassWithNullableDateTime
Child1 MonoReflectionTest.InheritsFromClassWithNullableDateTime

The key problem with this is that the second access to the MemberInfo's
DeclaringType and ReflectedType actually changes the DeclaringType's result
from MonoReflectionTest.ClassWithNullableDateTime (correct) to
MonoReflectionTest.InheritsFromClassWithNullableDateTime (reflected, not
declaring typed)

The attached demonstration program should contain a 100% reproducible test
case, that functions without mishap on MS's .Net 3.5.

Reproducible: Always

Steps to Reproduce:
<Attached script can be built as a standalone exe and the output results

Expected Results:  
I would expected ReflectedType and DeclaringType to be consistent between calls
and not change.  In the case of the attached program, I would specifically
expect the program output to reflect:
Child1 MonoReflectionTest.ClassWithNullableDateTime
Child1 MonoReflectionTest.ClassWithNullableDateTime

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