[Issue 7211] Initializing const members in derived classes' constructors

2018-04-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7211

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |FIXED

--- Comment #2 from RazvanN  ---
As Maksim said, the error has changed to "test.d(10): Error: cannot modify
immutable expression this.x". This  is the correct behavior since x is
constructed in the implicit super call to C. When D's constructor tries to
modify it, it is already cooked and cannot be modified. Closing as fixed.

--


[Issue 7211] Initializing const members in derived classes' constructors

2016-03-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7211

Maksim Zholudev  changed:

   What|Removed |Added

 CC||maxim...@gmail.com

--- Comment #1 from Maksim Zholudev  ---
The error message has been changed.

DMD 2.070.2:
test.d(10): Error: cannot modify immutable expression this.x

This is valid behavior if qualified members of classes are supposed to be dealt
as described here:
https://issues.dlang.org/show_bug.cgi?id=9665#c9
I wonder whether this is documented somewhere else.

--