diff test/bug6.d @ 32:a86fe7496b58 trunk

[svn r36] * Fixed a bug where passing a regular argument to a ref argument did not allocate storage
author lindquist
date Thu, 04 Oct 2007 18:24:05 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/bug6.d	Thu Oct 04 18:24:05 2007 +0200
@@ -0,0 +1,15 @@
+module bug6;
+class wrong { }
+void bark(ref wrong s) { s = new wrong; }
+void foo(wrong tree) {
+    auto old = tree;
+    bark(tree);
+    assert(old !is tree);
+}
+void main()
+{
+    auto w = new wrong;
+    auto old = w;
+    foo(w);
+    assert(w is old);
+}