http://d.puremagic.com/issues/show_bug.cgi?id=9665
Kenji Hara <k.hara...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|nob...@puremagic.com |and...@erdani.com --- Comment #1 from Kenji Hara <k.hara...@gmail.com> 2013-03-09 08:01:49 PST --- This is unfixable problem, if I'm not mistaken. Currently, compiler always considers opAssign operator overloading for all field "assignment" in constructor. struct S { T field; this(...) { field = xxx; } // If T has opAssign, it is called. } But for non-mutable field, opAssign invocation is not legal, because it may break const correctness. T* p; struct T { void opAssign(int n) { ...; p = &this; } } struct S { immutable T field; this(...) { field = 1; // invoke T.opAssign (currently not allowed) /* now global p holds mutable pointer to immutable T object! */ } } I have no answer for this issue... So, assigned to Andrei. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------