diff tests/mini/delegate2.d @ 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
children
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);
+}