digitalmars.D.bugs - [Issue 16245] New: the message emitted when a const function mutates
- via Digitalmars-d-bugs (25/26) Jul 07 2016 https://issues.dlang.org/show_bug.cgi?id=16245
https://issues.dlang.org/show_bug.cgi?id=16245 Issue ID: 16245 Summary: the message emitted when a const function mutates members is misleading Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: trivial Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: b2.temp gmx.com For struct Foo { int i; void foo() const{i = 1;} } DMD outputsError: cannot modify immutable expression this.iwhich can be interpreted as "i is const". The error message should rather be "Error: cannot modify %s in const function" --
Jul 07 2016