[Issue 13084] ModuleInfo.opApply delegate expects immutable parameter

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 18 21:17:01 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13084

--- Comment #28 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to Jacob Carlborg from comment #27)
> (In reply to Dicebot from comment #26)
> 
> > On actual topic: is there any reason why ModuleInfo itself needs to be
> > immutable and marking all its data members is not enough? That should still
> > make all the the options from PR #790 valid or am I missing something?
> 
> Exactly, I've already asked that but didn't get a reply on that question. Is
> it possible to write to the pointer that will cause problems?

ModuleInfo is a variable sized struct that is decoded at runtime. The two
explicit fields are only the start of it. Making the whole thing immutable
makes the intent clear.

--


More information about the Digitalmars-d-bugs mailing list