mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-05-04 17:31:29 +02:00
added test case for last commit (taking delegate of nested function of current function)
This commit is contained in:
12
tests/mini/delegate2.d
Normal file
12
tests/mini/delegate2.d
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
module mini.delegate2;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
int foo = 42;
|
||||||
|
int bar()
|
||||||
|
{
|
||||||
|
return foo;
|
||||||
|
}
|
||||||
|
int delegate() dg = &bar;
|
||||||
|
assert(dg() == foo);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user