[Issue 8193] New: wrong error message on escaping initialized immutable instance field

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 3 10:31:50 PDT 2012


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

           Summary: wrong error message on escaping initialized immutable
                    instance field
           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:33:47 PDT ---
DMD 2.059/2.060head:

struct A{
    immutable int z=2;
    auto foo(){return &z;}
}

Error: escaping reference to local z

Either z should not be accessible at all or the code should 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