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

           Summary: A simple std.array.array call at compile-time refused
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2013-11-03 03:31:19 PST ---
I think this should work, I don't know if this is a regression:


import std.array: array;
const r1 = [""].array; // Error
void main() {
    const r2 = [""].array; // OK
}


dmd 2.064beta4 gives:

...\dmd2\src\phobos\std\array.d(44): Error: returning a pointer to a local
stack variable
...\dmd2\src\phobos\std\array.d(48):        called from here:
trustedGetAddr(result[i])
...\dmd2\src\phobos\std\array.d(48):        called from here:
emplace(trustedGetAddr(result[i]), e)
test.d(2):        called from here: array([""])

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

Reply via email to