mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
16 lines
251 B
D
16 lines
251 B
D
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);
|
|
}
|