[Issue 3944] Require immutable annotation for new fields of class inherited from immutable class

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3944

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P2  |P4

--


[Issue 3944] Require immutable annotation for new fields of class inherited from immutable class

2010-07-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3944


Tim Verweij tjverw...@gmail.com changed:

   What|Removed |Added

 CC||tjverw...@gmail.com


--- Comment #1 from Tim Verweij tjverw...@gmail.com 2010-07-07 14:36:34 PDT 
---
Here's another situation that produces the same error message:

class Foo
{
 int x;
 immutable void bar() { x = 1; }
}

Error: can only initialize const member x inside constructor

It should probably report something along the lines of immutable member
function cannot modify member variables.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---