[Issue 4772] New: DMD allows "dereferencing" arrays as if it were a pointer to first element

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 31 04:32:59 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4772

           Summary: DMD allows "dereferencing" arrays as if it were a
                    pointer to first element
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: 2korden at gmail.com


--- Comment #0 from Koroskin Denis <2korden at gmail.com> 2010-08-31 04:32:44 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list