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
Comment #2 by github-bugzilla — 2013-06-19T20:39:16Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a4cd2d18d1b025cc2bb694614d0e85746375811e Fixes Issue 10415 - Bad diagnostic on writing to an r-value property return. https://github.com/D-Programming-Language/dmd/commit/97abb8a07361aca0b8ca0a9d0d3b71fdf40e0f61 Merge pull request #2227 from AndrejMitrovic/Fix10415 Issue 10415 - Bad diagnostic on writing to an r-value property return