Bug 7908 – Array operations fail when compiled with -d flag
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-14T06:17:55Z
Last change time
2020-05-24T08:21:39Z
Assigned to
No Owner
Creator
Eldar Insafutdinov
Comments
Comment #0 by e.insafutdinov — 2012-04-14T06:17:55Z
The following snippet fails when compiled with -d flag.
---
void main()
{
alias int* IntPtr;
auto values = new IntPtr[3];
for(int i = 0; i < values.length; ++i)
values[i] = new int;
auto copies = new IntPtr[values.length];
copies[] = values;
assert(values[1] == copies[1]);
}
---
As a result of the array operation the elements of "copies" are in fact equal to each other.
Comment #1 by e.insafutdinov — 2012-04-14T11:57:55Z
Something I forgot to add that it's a front end bug, because exactly the same is happening with ldc.