mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fix scope(exit) foreach (ref v; arr) foo(v);
This commit is contained in:
14
tests/mini/compile_scope_exit_foreach.d
Normal file
14
tests/mini/compile_scope_exit_foreach.d
Normal file
@@ -0,0 +1,14 @@
|
||||
module scope_exit_foreach;
|
||||
|
||||
void bar(size_t);
|
||||
|
||||
long foo(ubyte[] arr) {
|
||||
scope(exit) {
|
||||
foreach (ref b; arr) {
|
||||
bar(b);
|
||||
}
|
||||
}
|
||||
if (arr.length == 3)
|
||||
return 0;
|
||||
return arr.length;
|
||||
}
|
||||
Reference in New Issue
Block a user