Bug 4772 – DMD allows "dereferencing" arrays as if it were a pointer to first element

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-31T04:32:00Z
Last change time
2012-01-29T03:37:16Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
2korden

Comments

Comment #0 by 2korden — 2010-08-31T04:32:44Z
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 by bearophile_hugs — 2010-08-31T10:31:28Z
See bug 3990
Comment #2 by yebblies — 2012-01-29T03:37:16Z
*** This issue has been marked as a duplicate of issue 3990 ***