Bug 16245 – the message emitted when a const function mutates members is misleading

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-07T07:50:00Z
Last change time
2017-03-22T12:21:07Z
Assigned to
nobody
Creator
b2.temp

Comments

Comment #0 by b2.temp — 2016-07-07T07:50:50Z
For struct Foo { int i; void foo() const{i = 1;} } DMD outputs > Error: cannot modify immutable expression this.i which can be interpreted as "i is const". The error message should rather be "Error: cannot modify %s in const function"
Comment #1 by github-bugzilla — 2017-01-14T21:26:53Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/141c88bcfaa1c5b79ac4d5c6dd7b278d11b5de84 fix issue 16245 - the message emitted when a const function mutates members is misleading https://github.com/dlang/dmd/commit/ff98747bf365c03da1a7742fa9d432e6d8efb6c4 Merge pull request #6441 from BBasile/issue-16245 fix issue 16245 - the message emitted when a const function mutates members is misleading
Comment #2 by github-bugzilla — 2017-01-16T23:26:34Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/141c88bcfaa1c5b79ac4d5c6dd7b278d11b5de84 fix issue 16245 - the message emitted when a const function mutates members is misleading https://github.com/dlang/dmd/commit/ff98747bf365c03da1a7742fa9d432e6d8efb6c4 Merge pull request #6441 from BBasile/issue-16245
Comment #3 by github-bugzilla — 2017-03-22T12:21:07Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/141c88bcfaa1c5b79ac4d5c6dd7b278d11b5de84 fix issue 16245 - the message emitted when a const function mutates members is misleading https://github.com/dlang/dmd/commit/ff98747bf365c03da1a7742fa9d432e6d8efb6c4 Merge pull request #6441 from BBasile/issue-16245