Mercurial > projects > dstress
view run/b/bug_declaration_440_B.d @ 1597:8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 09 Sep 2008 16:53:58 +0200 |
parents | 20d8ee6523e1 |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ // @author@ simon hudon <simon_member@pathlink.com> // @date@ 2006-07-17 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=7907 // @desc@ foreach on aggregate class in some delegate litterals module dstress.run.b.bug_declaration_440_B; int[] status; class Container { int opApply (int delegate (ref int) dg) { int counter = 3; dg(counter); counter--; dg(counter); return 0; } } int main() { auto a = ( delegate{ foreach (i ; new Container()){ status ~= i; } } ); if(status.length != 0){ assert(0); } a(); if(status.length != 2){ assert(0); } if((status[0] != 3) || (status[1] != 2)){ assert(0); } return 0; }