[Issue 5729] New: taking the address of a @property doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 11 08:53:24 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5729

           Summary: taking the address of a @property doesn't work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: mrmocool at gmx.de


--- Comment #0 from Trass3r <mrmocool at gmx.de> 2011-03-11 08:50:19 PST ---
class A
{
    private int blub = 5;
    @property ref int bla()
    {return blub;}
}

void main()
{
    A a = new A();
    int* b = &a.bla;
}

property.d(11): Error: cannot implicitly convert expression (&a.bla) of type
int delegate() @property ref to int*


This only works by adding parentheses: &a.bla()
Shouldn't it work as expected without those for @property methods?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list