Bug 2736 – ref returns from 'properties' can't be the LHS of augmentation assignment
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-15T12:18:00Z
Last change time
2015-06-09T01:21:08Z
Keywords
rejects-valid
Assigned to
nobody
Creator
jarrett.billingsley
Comments
Comment #0 by jarrett.billingsley — 2009-03-15T12:18:20Z
struct S
{
int mX;
ref int x()
{
return mX;
}
}
void main()
{
S s;
s.x += 4; // line 20
}
foo.d(20): Error: 's.x' is not a scalar, it is a ref int()
foo.d(20): Error: incompatible types for ((s.x) += (4)): 'ref int()' and 'int'
foo.d(20): Error: 's.x' is not of arithmetic type, it is a ref int()
Comment #1 by k.hara.pg — 2011-06-19T03:49:07Z
Issue 3511 is similar issue.
It is about LHS of AssignExp, and this issue is about LHS of BinAssignExp (+=, -=, *=, /=, %=, ~=, etc.)
Comment #2 by yebblies — 2011-07-02T22:29:10Z
This works with dmd from github. Probably fixed by the @property patch.