//# publish module 0x42.M { import 0x1.signer; struct R1 has key { f: bool } struct R2 has key { f: T } public store(sender: &signer, f: bool) { label b0: move_to(copy(sender), R1 { f: move(f) }); return; } public store_gen(sender: &signer, t: T) { label b0: move_to>(copy(sender), R2 { f: move(t) }); return; } public read(s: &signer): bool acquires R1 { label b0: return *&(borrow_global(signer.address_of(move(s)))).R1::f; } public read_gen(s: &signer): T acquires R2 { label b0: return *&(borrow_global>(signer.address_of(move(s)))).R2::f; // problem is here } } //# run --signers 0x42 import 0x42.M; main(sender: signer) { label b0: M.store(&sender, false); assert((M.read(&sender) == false), 42); M.store_gen(&sender, true); assert((M.read_gen(&sender) == true), 42); M.store_gen(&sender, 112); assert((M.read_gen(&sender) == 112), 42); return; } //# run --signers 0xA import 0x42.M; main(sender: signer) { label b0: M.store(&sender, false); M.store_gen(&sender, true); M.store_gen(&sender, 112); return; } //# run --signers 0xA import 0x42.M; main(sender: signer) { label b0: assert((M.read(&sender) == false), 42); assert((M.read_gen(&sender) == true), 42); assert((M.read_gen(&sender) == 112), 42); return; }