In the documentation on arrays, under "usage" is mentioned this sequence:
int* p;
int[3] s;
p = s; // p points to the first element of the array s.
However, this causes the following message from the compiler:
"cannot implicitly convert expression (s) of type int[3] to int*."
It seems the documentation needs to be updated. I only stumbled on one of the cases (the above) but there might be more cases that need revisit.
Bug was reported for version 1.007, but it still exists in 2.012.
Comment #3 by smjg — 2009-03-06T18:56:10Z
This bug is filed against a D1 version, so surely the URL given should be to the D1 docs. Also correcting platform and component.
Comment #4 by kamm-removethis — 2009-06-30T10:42:53Z
Marking with patch, since this fix is trivial:
change
p = q;
p = s;
p = a;
to
p = q;
p = s.ptr;
p = a.ptr;
Comment #5 by dfj1esp02 — 2009-07-02T02:12:53Z
ha-ha, the patch keyword is for bugs that have patch fixing them
Comment #6 by kamm-removethis — 2009-07-02T02:46:42Z
I honestly think it'd take longer for Walter to look at, download and apply a 'real patch' than for him to open arrays.dd and add the .ptr to lines 148/149 manually.
Comment #7 by dfj1esp02 — 2009-07-02T02:53:20Z
The same bug is in the string section: "A pointer to a char can be generated".
Comment #8 by clugdbug — 2010-06-18T12:06:23Z
Fixed in phobos commit 1663. Don't know how this one stuck around for so long.