mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
This commit is contained in:
19
tests/mini/bug20.d
Normal file
19
tests/mini/bug20.d
Normal file
@@ -0,0 +1,19 @@
|
||||
module bug20;
|
||||
extern(C) int printf(char*, ...);
|
||||
|
||||
void func(void delegate() dg)
|
||||
{
|
||||
dg();
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
int i = 42;
|
||||
void delegate() dg = {
|
||||
i++;
|
||||
};
|
||||
printf("i = %d\n",i);
|
||||
func(dg);
|
||||
printf("i = %d\n",i);
|
||||
assert(i == 43);
|
||||
}
|
||||
Reference in New Issue
Block a user