Bug 15158 – Better error message: "Property is not an lvalue, use 'ref' to make it so"

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-05T01:21:34Z
Last change time
2017-08-14T23:08:13Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Eli Sternheim

Comments

Comment #0 by eli — 2015-10-05T01:21:34Z
The error message: "function tmp.s.l () is not callable using argument types (int)" is not very informative. Instead the message should be "Property l is not an lvalue. Use 'ref' to make it so" Test case: struct s { long a; //@property ref long l() {return a;} @property long l() {return a;} } void main () { auto s1=new s; s1.l = 0; }
Comment #1 by slavo5150 — 2017-08-14T23:08:13Z
*** This issue has been marked as a duplicate of issue 5010 ***