[Issue 5798] Weakly pure function calls skipped inside a comma expression

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 24 02:44:07 PDT 2011


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



--- Comment #7 from Lars T. Kyllingstad <bugzilla at kyllingen.net> 2011-06-24 02:39:10 PDT ---
Adding my test case from issue 6206 here, since it's much smaller and doesn't
pull in any Phobos modules.

    struct S
    {
        int i = 0;
        void incr() pure { ++i; }
    }

    void main()
    {
        S s;
        for (int j=0; j<10; s.incr(), ++j) { }
        assert (s.i == 10); // fails
    }

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