// check: VerificationError { kind: FunctionDefinition, idx: 2, err: WriteRefResourceError(7) } module A { import 0x0.LibraCoin; resource A { c: R#LibraCoin.T } public new(c: R#LibraCoin.T): R#Self.A { return A { c: move(c) }; } public destroy_a(a: R#Self.A) { let c: R#LibraCoin.T; A { c } = move(a); LibraCoin.destroy_zero(move(c)); return; } public mutate(a_ref: &mut R#Self.A) { let ref: &mut R#LibraCoin.T; let zero: R#LibraCoin.T; ref = &mut move(a_ref).c; zero = LibraCoin.zero(); *move(ref) = move(zero); return; } } //! new-transaction import {{default}}.A; import 0x0.LibraCoin; main() { let zero_resource: R#LibraCoin.T; let s: R#A.A; zero_resource = LibraCoin.zero(); s = A.new(move(zero_resource)); A.mutate(&mut s); A.destroy_a(move(s)); return; }