annotate tests/mini/bug6.d @ 341:1bb99290e03a trunk

[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author lindquist
date Sun, 13 Jul 2008 02:51:19 +0200
parents test/bug6.d@a86fe7496b58
children
rev   line source
lindquist@32 1 module bug6;
lindquist@32 2 class wrong { }
lindquist@32 3 void bark(ref wrong s) { s = new wrong; }
lindquist@32 4 void foo(wrong tree) {
lindquist@32 5 auto old = tree;
lindquist@32 6 bark(tree);
lindquist@32 7 assert(old !is tree);
lindquist@32 8 }
lindquist@32 9 void main()
lindquist@32 10 {
lindquist@32 11 auto w = new wrong;
lindquist@32 12 auto old = w;
lindquist@32 13 foo(w);
lindquist@32 14 assert(w is old);
lindquist@32 15 }