mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-03-05 20:03:28 +01:00
Add test for accessing foreachval in nested func. Reason for #104.
This commit is contained in:
17
tests/mini/nested20.d
Normal file
17
tests/mini/nested20.d
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user