[Issue 8526] DMD 2.060 regression: anonymous delegate call in foreach loop

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 8 19:45:43 PST 2012


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



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2012-11-08 19:45:42 PST ---
>From bug 8775, foreach range statement has same bug.

void call(void delegate() dg) { dg(); }
void main()
{
    foreach (i, j; [0])
    {
        call({
            assert(i == 0); // fails, i is corrupted
        });
    }

    foreach (n; 0..1)
    {
        call({
            assert(n == 0); // fails, n is corrupted
        });
    }
}

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