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

           Summary: fix invariant
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2011-09-11 11:22:02 PDT ---
Consider:

struct S{
    int x=1;
    invariant(){assert(x==1);}
    void foo(){x=2;bar(1);}
    void bar(int i){x=i;}
}

void main(){
    S s;
    s.foo();
}

This should run fine, but currently it throws an AssertError.
Because of this, D's invariant is mostly useless outside toy examples.

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

Reply via email to