[Mono-bugs] [Bug 373190] New: (g)mcs always emits static properties

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Mar 23 14:29:09 EDT 2008


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


           Summary: (g)mcs always emits static properties
           Product: Mono: Compilers
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: gert.driesen at pandora.be
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


When a given property is an instance property, then (g)mcs correctly emits
instance accessors but the property itself is still static.

To fix this for gmcs, we need use the DefineProperty overload that takes a
CallingConventions argument. This property was introduced in .NET 2.0 SP1. For
mcs, we'll need to use reflection to invoke an internal method.

To reproduce, compile the following code (using /target:library) and then
disassembly it:

public class Foo
{
        public bool A {
                get { return false; }
        }

        public static bool B {
                get { return false; }
        }
}

Expected result:

property instance bool A()
{
  .get instance bool Foo::get_A()
}
property bool B()
{
  .get bool Foo::get_B()
}

Actual result:

property bool A()
{
  .get instance bool Foo::get_A()
}
property bool B()
{
  .get bool Foo::get_B()
}


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