[Issue 8192] New: inconsistent behavior of initialized immutable instance fields

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 3 10:17:21 PDT 2012


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

           Summary: inconsistent behavior of initialized immutable
                    instance fields
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: timon.gehr at gmx.ch


--- Comment #0 from timon.gehr at gmx.ch 2012-06-03 10:19:14 PDT ---
DMD 2.059:

struct S{ immutable y = 1; }
void main(){
    writeln(S.y);       // ok
    writeln(&S.y);      // error
    with(S){
        writeln(&y);    // ok  
        assert(*&y==y); // fail
    }
}

Either the code should run through or all the commented lines should fail to
compile.

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