Mercurial > projects > dstress
changeset 533:c8f0ffd00273
nested foreach and opApply
pragma <pragma_member@pathlink.com>
2005-05-12
news:d6010n$i01$1@digitaldaemon.com
author | thomask |
---|---|
date | Sat, 14 May 2005 05:12:26 +0000 |
parents | 3de87fd6e82d |
children | 5068f863e9c2 |
files | compile/f/foreach_30_A.d compile/f/foreach_30_B.d |
diffstat | 2 files changed, 57 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/f/foreach_30_A.d Sat May 14 05:12:26 2005 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ pragma <pragma_member@pathlink.com> +// @date@ 2005-05-12 +// @uri@ news:d6010n$i01$1@digitaldaemon.com + +module dstress.compile.f.foreach_30_A; + +class Collection{ + int opApply(int delegate(inout int) dg){ + return 0; + } +} + +bool test(){ + Collection a,b; + + foreach(int x; a){ + foreach(int y; b){ + return false; + } + } + + return true; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/f/foreach_30_B.d Sat May 14 05:12:26 2005 +0000 @@ -0,0 +1,30 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ pragma <pragma_member@pathlink.com> +// @date@ 2005-05-12 +// @uri@ news:d6010n$i01$1@digitaldaemon.com + +module dstress.compile.f.foreach_30_B; + +class Collection{ + int opApply(int delegate(inout int) dg){ + return 0; + } +} + +bool test(){ + Collection a,b; + + foreach(int x; a){ + foreach(int y; b){ + goto label; + } + } + + return true; + +label: + return false; +}