module Test { resource X { } resource T { i: u64, x: R#Self.X, b: bool } public new_x(): R#Self.X { return X { }; } public new_t(x: R#Self.X): R#Self.T { return T { i: 0, x: move(x), b: false }; } public destroy_x(x: R#Self.X) { X { } = move(x); return; } public destroy_t(t: R#Self.T): u64 * R#Self.X * bool { let i: u64; let x: R#Self.X; let flag: bool; T { i, x, b: flag } = move(t); return move(i), move(x), move(flag); } } //! new-transaction import {{default}}.Test; main() { let x: R#Test.X; let i: u64; let t: R#Test.T; let b: bool; x = Test.new_x(); t = Test.new_t(move(x)); i, x, b = Test.destroy_t(move(t)); Test.destroy_x(move(x)); return; }