[Issue 9557] New: std.array.array of array of immutable structs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 21 09:49:23 PST 2013


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

           Summary: std.array.array of array of immutable structs
           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 2013-02-21 09:49:22 PST ---
import std.array: array;
struct Foo {
    immutable int x;
}
void main() {
    immutable a = [Foo(1)];
    auto r = a.array();
}


DMD 2.062:

...\dmd2\src\phobos\std\array.d(58): Error: cannot modify struct result[i] Foo
with immutable members
test.d(7): Error: template instance std.array.array!(immutable(Foo)[]) error
instantiating

-- 
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