module B { struct T{g: u64} public new(g: u64): V#Self.T { return T{g: move(g)}; } public t(this: &mut V#Self.T) { let g: &mut u64; g = &mut copy(this).g; *copy(g) = 2; assert(*move(g) == 2, 42); release(move(this)); return; } } //! new-transaction module A { import {{default}}.B; struct T{f: V#B.T} public new(f: V#B.T): V#Self.T { return T{f: move(f)}; } public t(this: &mut V#Self.T) { let f: &mut V#B.T; f = &mut copy(this).f; B.t(move(f)); release(move(this)); return; } } //! new-transaction import {{default}}.A; import {{default}}.B; main() { let b: V#B.T; let x: V#A.T; let x_ref: &mut V#A.T; b = B.new(0); x = A.new(move(b)); x_ref = &mut x; A.t(move(x_ref)); return; }