comparison 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
comparison
equal deleted inserted replaced
742:05e7657a7811 743:720ec515c300
1 extern(C) int printf(char*, ...);
2
3 void main()
4 {
5 int[] arr = [1];
6 foreach(s; arr)
7 {
8 void foo()
9 {
10 printf("n %d\n", s);
11 }
12
13 printf("o1 %d\n", s);
14 foo();
15 printf("o2 %d\n", s);
16 }
17 }