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

           Summary: Immutable correctness is broken
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: zan77...@nifty.com


--- Comment #0 from SHOO <zan77...@nifty.com> 2010-12-06 03:53:59 PST ---
This code shouldn't work:
------------------------------
import std.stdio;
struct ID
{
    immutable int value;
}

struct Data
{
    ID id;
}
void main()
{
    Data data = Data(ID(1));
    immutable int* val = &data.id.value;
    writeln(*val); // 1
    data = Data(ID(2)); // <- This line shouldn't be allowed.
    writeln(*val); // 2
}

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

Reply via email to