// check: VerificationError { kind: FunctionDefinition, idx: 1, err: CallTypeMismatchError(4) } module B { struct T{g: u64} public new(g: u64): V#Self.T { return T{g: move(g)}; } public t(this: &V#Self.T): &u64 { let g: &u64; g = &move(this).g; return move(g); } } //! 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 ref1: &mut V#B.T; let ref2: &u64; let b2: V#B.T; ref1 = &mut move(this).f; ref2 = B.t(copy(ref1)); b2 = B.new(3); *move(ref1) = move(b2); 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; }