996 – Error in doc on implicit conversion between pointer and array

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 996 - Error in doc on implicit conversion between pointer and array
Summary: Error in doc on implicit conversion between pointer and array
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: No Owner
URL: http://www.digitalmars.com/d/1.0/arra...
Keywords: patch, rejects-valid, spec
Depends on:
Blocks: 677
Show dependency tree / graph
Reported: 2007年02月22日 08:55 UTC by Henrik Harmsen
Modified: 2014年02月16日 15:23 UTC (History)
4 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Henrik Harmsen 2007年02月22日 08:55:52 UTC
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.
Comment 1 Gide Nwawudu 2008年04月17日 09:23:02 UTC
Added URL: http://www.digitalmars.com/d/2.0/arrays.html.
Comment 2 anonymous4 2008年04月25日 14:50:47 UTC
Bug was reported for version 1.007, but it still exists in 2.012.
Comment 3 Stewart Gordon 2009年03月06日 18:56:10 UTC
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 Christian Kamm 2009年06月30日 10:42:53 UTC
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 anonymous4 2009年07月02日 02:12:53 UTC
ha-ha, the patch keyword is for bugs that have patch fixing them
Comment 6 Christian Kamm 2009年07月02日 02:46:42 UTC
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 anonymous4 2009年07月02日 02:53:20 UTC
The same bug is in the string section: "A pointer to a char can be generated".
Comment 8 Don 2010年06月18日 12:06:23 UTC
Fixed in phobos commit 1663. Don't know how this one stuck around for so long.


AltStyle によって変換されたページ (->オリジナル) /