[Issue 4521] Array-wise assignment on unallocated array is accepted
http://d.puremagic.com/issues/show_bug.cgi?id=4521 bearophile_h...@eml.cc changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4521] Array-wise assignment on unallocated array is accepted
http://d.puremagic.com/issues/show_bug.cgi?id=4521 --- Comment #5 from Andrej Mitrovic 2010-07-28 06:38:07 PDT --- Actually I think I'm confusing myself with how dynamic allocation works. I thought the dynamic array always have to be called with new, but it appears I can change the length of an array without calling new in the first place, e.g.: int[] a; a.length = 4; a[] = 4; writeln(a); // writes 4 4 4 4 So this should probably get closed. Sorry for the confusion. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4521] Array-wise assignment on unallocated array is accepted
http://d.puremagic.com/issues/show_bug.cgi?id=4521 --- Comment #4 from Andrej Mitrovic 2010-07-28 05:55:29 PDT --- But isn't there a difference between arrays that had all of their elements removed and arrays that have not yet been allocated in the first place? I filed it since Walter seems to have confirmed this: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114041 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4521] Array-wise assignment on unallocated array is accepted
http://d.puremagic.com/issues/show_bug.cgi?id=4521 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #3 from bearophile_h...@eml.cc 2010-07-28 04:19:38 PDT --- This is not a bug, I think this can be closed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4521] Array-wise assignment on unallocated array is accepted
http://d.puremagic.com/issues/show_bug.cgi?id=4521 Don changed: What|Removed |Added Keywords||accepts-invalid CC||clugd...@yahoo.com.au Summary|accepts-invalid Array-wise |Array-wise assignment on |assignment on unallocated |unallocated array is |array is accepted |accepted --- Comment #2 from Don 2010-07-27 23:57:22 PDT --- (In reply to comment #1) > Maybe I'm missing something, but no it should not. > "c[] = 4;" just sets every array element to 4, and it works even if there are > 0 > array elements. Yes. Some related situations are definitely bugs though. Perhaps this one should be marked as a duplicate of bug 2547. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---