// check: VerificationError { kind: FunctionDefinition, idx: 1, err: WriteRefExistsBorrowError(10) } module B { struct T{g: u64} public new(g: u64): V#Self.T { return T { g: move(g) }; } } //! new-transaction module A { import Transaction.B; struct T{value: V#B.T} public new(m: V#B.T): V#Self.T { return T{value: move(m)}; } public t(this: &mut V#Self.T) { let ref1: &mut V#B.T; let ref2: &mut V#B.T; let b2: V#B.T; let x: V#B.T; ref1 = &mut move(this).value; ref2 = copy(ref1); b2 = B.new(3); *move(ref1) = move(b2); x = *move(ref2); return; } } //! new-transaction import {{default}}.A; import {{default}}.B; main() { let b: V#B.T; let a: V#A.T; let a_ref: &mut V#A.T; b = B.new(1); a = A.new(move(b)); a_ref = &mut a; A.t(move(a_ref)); return; }