comparison 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
comparison
equal deleted inserted replaced
31:2841234d2aea 32:a86fe7496b58
1 module bug6;
2 class wrong { }
3 void bark(ref wrong s) { s = new wrong; }
4 void foo(wrong tree) {
5 auto old = tree;
6 bark(tree);
7 assert(old !is tree);
8 }
9 void main()
10 {
11 auto w = new wrong;
12 auto old = w;
13 foo(w);
14 assert(w is old);
15 }