http://d.puremagic.com/issues/show_bug.cgi?id=4397
Don <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code |performance --- Comment #9 from Don <[email protected]> 2010-07-28 23:01:36 PDT --- (In reply to comment #8) > Well... there can be a problem with immutable literals because immutability is > transitive... hmm... > Even if literals aren't immutable, compiler can still catch assignment of > literal to mutable array and report error. But it is EXPLICITLY LEGAL to assign a literal to a mutable array. There is an invisible dup by design. I don't like this, I argued strongly against it, but it's in there. This isn't wrong code. (Similarly, you can write const C x = new C; The C will be allocated on the heap, even though it will never change afterwards). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
