www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1873] New: structs with at least one immutable member are completely immutable

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1873

           Summary: structs with at least one immutable member are
                    completely immutable
           Product: D
           Version: 2.011
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: ludwig informatik.uni-luebeck.de


The following code fails to compile, although 'x' should be mutable:

struct S {
        invariant int dummy; // const gives the same result
        int x;
}

int main(){
        S s;
        s.x = 1; // error: cannot modify struct with immutable members
        return 0;
}


-- 
Feb 27 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1873


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 2.012


-- 
Mar 06 2008