comparison tests/mini/compile_scope_exit_foreach.d @ 1411:e57859ca8f1e

Fix `scope(exit) foreach (ref v; arr) foo(v);`
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 22 May 2009 21:38:01 +0200
parents
children
comparison
equal deleted inserted replaced
1410:cc2d8a7388c7 1411:e57859ca8f1e
1 module scope_exit_foreach;
2
3 void bar(size_t);
4
5 long foo(ubyte[] arr) {
6 scope(exit) {
7 foreach (ref b; arr) {
8 bar(b);
9 }
10 }
11 if (arr.length == 3)
12 return 0;
13 return arr.length;
14 }