//# publish module 0x42.B { struct T has drop {g: u64} public new(g: u64): Self.T { label b0: return T{g: move(g)}; } public t(this: &Self.T): &u64 { let g: &u64; label b0: g = &move(this).T::g; return move(g); } } //# publish module 0x42.A { import 0x42.B; struct T{f: B.T} public new(f: B.T): Self.T { label b0: return T{f: move(f)}; } public t(this: &mut Self.T) { let ref1: &mut B.T; let ref2: &u64; let b2: B.T; label b0: ref1 = &mut move(this).T::f; ref2 = B.t(freeze(copy(ref1))); b2 = B.new(3); // cannot modify, ref2 still borrows ref1 *move(ref1) = move(b2); return; } }