[svn r36] * Fixed a bug where passing a regular argument to a ref argument did not allocate storage

This commit is contained in:
Tomas Lindquist Olsen
2007-10-04 18:24:05 +02:00
parent 56d2cff2a2
commit e4eaf0455d
3 changed files with 107 additions and 1 deletions

15
test/bug6.d Normal file
View File

@@ -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);
}