diff test/staticvars.d @ 26:99737f94abfb trunk

[svn r30] * Fixed static function-local variables. * Fixed CondExp - bool ? true : false
author lindquist
date Thu, 04 Oct 2007 10:57:26 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/staticvars.d	Thu Oct 04 10:57:26 2007 +0200
@@ -0,0 +1,13 @@
+module staticvars;
+
+int func()
+{
+    static int i;
+    return i++;
+}
+
+void main()
+{
+    assert(func() == 0);
+    assert(func() == 1);
+}