January 07, 2013

           Summary: Static array return value implicitly converted to
                    immutable dynamic array
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: sludwig@outerproduct.org

--- Comment #0 from Sönke Ludwig <sludwig@outerproduct.org> 2013-01-07 12:29:25 PST ---
The following compiles without error:

char[2] b()()
    char[2] ret;
    return ret;

string a()
    return b();

Changing b to a normal function causes the correct error message that an implicit conversion of char[2u] to string is not possible.

Note that this affects std.digest.digest.toHexString(). Returnung
toHexString(digest) from a function will result in a corrupted string.

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