module Token { resource T { count: u64 } public test() { let t_ref: &mut R#Self.T; let count_ref: &mut u64; let local: u64; let local_ref: &mut u64; let sender: address; move_to_sender(T { count: 0 }); sender = get_txn_sender(); t_ref = borrow_global(move(sender)); count_ref = &mut move(t_ref).count; local = 0; local_ref = &mut local; // checks that the ref count is decremented // checks that we consider refs as "equal" regardless of source being global or local assert(move(count_ref) == move(local_ref), 42); return; } } //! new-transaction import {{default}}.Token; main() { Token.test(); return; }