[Issue 5681] New: @property doesn't work with ref return value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 2 04:45:34 PST 2011


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

           Summary: @property doesn't work with ref return value
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: magnus at hetland.org


--- Comment #0 from Magnus Lie Hetland <magnus at hetland.org> 2011-03-02 04:42:42 PST ---
It seems that a @property that returns a ref value erroneously looks for a
setter function when it's assigned to.

class Foo {
    int _x;
    @property ref x() {
        return _x;
    }
}

With an instanfe f, the statement f.x = 1 won't work, because DMD looks for a
setter, f.x(int). The assignment f.x() = 1 works, though.

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