Bug 10415 – Bad error message with const property of const class instance
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-19T10:23:00Z
Last change time
2013-06-19T20:40:33Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-06-19T10:23:02Z
Title:
Component: dmd
Severity:
Code number:
Keywords:
Outcome:
Is done: no
See also:
class Foo {
@property int bar() const {
return 0;
}
@property void bar(int) {}
}
void main() {
const x = new Foo;
x.bar = 1;
}
DMD 2.063.2 gives a bad error message, that is wrong and doesn't explain the true nature of the problem:
test.d(9): Error: not a property x.bar
Comment #1 by andrej.mitrovich — 2013-06-19T10:41:28Z