[Issue 4251] Hole in the const system: immutable values can be overwritten (const(T) is appendable to const(T)[])

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 16 08:10:45 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=4251



--- Comment #7 from Steven Schveighoffer <schveiguy at yahoo.com> 2011-06-16 08:06:02 PDT ---
I think the cases are all sound.

In order for there to be a problem, both mutable and immutable data need to be
castable into const.  If you cannot cast mutable into const N references deep,
then you can't accidentally rebind it to immutable data.

This all stems from being able to treat mutable data as const, and also as
mutable at the same time.  Being able to treat immutable data as const and
immutable at the same time does not cause any harm.

This is definitely one of those things that makes my brain hurt... It's like 4
dimensional geometry :)

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


More information about the Digitalmars-d-bugs mailing list