Debian Codegraph @

src/test/01-Basic/227-dangle-ref-func2.ck

raw
1 class Foo
2 {
3 int i;
4 }
5
6 fun void go( Foo foo )
7 {
8 if( Machine.refcount(foo) != 2 ) <<< "problem found" >>>;
9 }
10
11 Foo foo;
12
13 go( foo );
14
15 // test
16 if( Machine.refcount(foo) == 1 ) <<< "success" >>>;