[Issue 4791] Assigning a static array to itself should be allowed

2018-04-24 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4791

Mike Franklin  changed:

   What|Removed |Added

   See Also||https://issues.dlang.org/sh
   ||ow_bug.cgi?id=11970

--


[Issue 4791] Assigning a static array to itself should be allowed

2014-06-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4791

--- Comment #5 from bearophile_h...@eml.cc ---
(In reply to David Simcha from comment #2)
> Yes, and this is a nightmare for generic code.

A recent bug in my code (I have used a loop to avoid the overhead of calling
the runtime function):


void main() {
int[3] a, b, c;
foreach (immutable i; 0 .. a.length)
c = a[i] + b[i];
}


The correct foreach body is instead:

c[i] = a[i] + b[i];


So I think there are disadvantages at not requiring a [] syntax for all
array-wide operations.

--


[Issue 4791] Assigning a static array to itself should be allowed

2014-06-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4791

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4157e764c620984376da81d67eb83e67fb725d6e
fix Issue 4791 - Assigning a static array to itself should be allowed

https://github.com/D-Programming-Language/dmd/commit/d2347f6265a63fc15a4c478f109b32b0eb67ad1b
Merge pull request #3628 from 9rnsr/fix4791

Issue 4791 - Assigning a static array to itself should be allowed

--


[Issue 4791] Assigning a static array to itself should be allowed

2014-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4791

Kenji Hara  changed:

   What|Removed |Added

   Keywords||pull, rejects-valid
   Hardware|Other   |All
 OS|Windows |All

--- Comment #3 from Kenji Hara  ---
The root issue is a dup of bug 12212, and it's properly fixed in 2.066
git-head.

I'll add a case to the dmd test suite to avoid regressions.
https://github.com/D-Programming-Language/dmd/pull/3628

--


[Issue 4791] Assigning a static array to itself should be allowed

2010-09-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4791



--- Comment #2 from David Simcha  2010-09-03 05:25:43 PDT ---
Yes, and this is a nightmare for generic code.

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


[Issue 4791] Assigning a static array to itself should be allowed

2010-09-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4791


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #1 from bearophile_h...@eml.cc 2010-09-03 04:39:48 PDT ---
The only correct syntax to write that code is this, see bug 3971

void main() {
int[2] foo;
foo[] = foo[];
}

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