changeset 635:ce95d269bf5a

added test case for last commit (taking delegate of nested function of current function)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 02 Oct 2008 01:38:00 +0200
parents 0084d2c76b74
children 9fb1f559d9e9
files tests/mini/delegate2.d
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/mini/delegate2.d	Thu Oct 02 01:38:00 2008 +0200
@@ -0,0 +1,12 @@
+module mini.delegate2;
+
+void main()
+{
+    int foo = 42;
+    int bar()
+    {
+        return foo;
+    }
+    int delegate() dg = &bar;
+    assert(dg() == foo);
+}