Mercurial > projects > ldc
diff tests/mini/nested20.d @ 743:720ec515c300
Add test for accessing foreachval in nested func. Reason for #104.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 31 Oct 2008 18:17:28 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/mini/nested20.d Fri Oct 31 18:17:28 2008 +0100 @@ -0,0 +1,17 @@ +extern(C) int printf(char*, ...); + +void main() +{ + int[] arr = [1]; + foreach(s; arr) + { + void foo() + { + printf("n %d\n", s); + } + + printf("o1 %d\n", s); + foo(); + printf("o2 %d\n", s); + } +}