Bug 5681 – @property doesn't work with ref return value

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2011-03-02T04:42:00Z
Last change time
2011-06-18T01:01:45Z
Assigned to
nobody
Creator
magnus

Comments

Comment #0 by magnus — 2011-03-02T04:42:42Z
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.
Comment #1 by k.hara.pg — 2011-06-18T01:01:45Z
*** This issue has been marked as a duplicate of issue 3511 ***