[Issue 12315] New: std.array.array at compile-time too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 8 07:02:13 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12315

           Summary: std.array.array at compile-time too
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2014-03-08 07:02:11 PST ---
import std.array: array;
struct Foo1 {
    int i;
}
struct Foo2 {
    immutable int i;
}
void main() {
    enum r1 = [Foo1(1)].array; // OK
    enum r2 = [Foo2(1)].array; // Error
}


dmd 2.066alpha gives:

...\dmd2\src\phobos\std\conv.d(3908,23): Error: memcpy cannot be interpreted at
compile time, because it has no available source code
...\dmd2\src\phobos\std\array.d(45,23):        called from here:
emplaceRef(result[i], e)
temp.d(10,24):        called from here: array([Foo2(1)])

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


More information about the Digitalmars-d-bugs mailing list