On Sat, 01 Nov 2014 11:55:53 +0000 anonymous via Digitalmars-d <[email protected]> wrote:
> On Saturday, 1 November 2014 at 11:50:34 UTC, ketmar via > Digitalmars-d wrote: > > this *IS* a bug. either compiler should error on this, or it > > shouldn't > > modify random memory. imagine the situation when old array > > contents not > > only collected by GC, but that memory was allocated to something > > completely different. > > The old array is still alive and kicking. The left-hand side > still references it. It wasn't collected. You're not writing to > random memory. so it's not only writes to the stale copy, but protects that copy from GC. what a great thing! and all this without even a small warning from compiler. i can expect such behavior from c or c++ with all their UB, but not from D. this is not only ugly, this is plainly wrong.
signature.asc
Description: PGP signature
