D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4772 - DMD allows "dereferencing" arrays as if it were a pointer to first element
Summary: DMD allows "dereferencing" arrays as if it were a pointer to first element
Status: RESOLVED DUPLICATE of issue 3990
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2010-08-31 04:32 UTC by Koroskin Denis
Modified: 2012-01-29 03:37 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Koroskin Denis 2010-08-31 04:32:44 UTC
import std.stdio;
void main()
{
    string foo = "foo";
    int[] bar = [ 42 ];

    writeln(*foo, *bar); // prints "f42"
}

I don't think this is intended and should be disallowed.
Comment 1 bearophile_hugs 2010-08-31 10:31:28 UTC
See bug 3990
Comment 2 yebblies 2012-01-29 03:37:16 UTC

*** This issue has been marked as a duplicate of issue 3990 ***