mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01: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