mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 10:33:14 +01:00
[svn r36] * Fixed a bug where passing a regular argument to a ref argument did not allocate storage
This commit is contained in:
15
test/bug6.d
Normal file
15
test/bug6.d
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user