#line 1 "-" #line 1 "test/destructor.g" /* How many times is the destructor called? */ let x = @int(0); class foo { foo() { } ~foo() { x = x + 1; } }; fun operator=(foo! x, foo y) -> foo! { return x; } fun bar() { let f = @foo(); /* 1: f */ f = @foo(); /* 1: temporary from foo() */ } fun main() -> int@ { bar(); return 2 - x; }