www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6298] New: ref breaks struct immutability

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

           Summary: ref breaks struct immutability
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



With DMD 2.054 this code compiles and runs, but I think this is not good:


struct Foo {
    int x;
}
void bar(ref Foo f) {
    f.x++;
}
void main() {
    immutable Foo f;
    bar(f);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6298


Steven Schveighoffer <schveiguy yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy yahoo.com
         Resolution|                            |DUPLICATE



13:05:59 PDT ---
*** This issue has been marked as a duplicate of issue 5493 ***

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