You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//# publish --verbose
module 0xc0ffee::m
public fun f(): ||u64
local x: u64
ld_u64 0
st_loc x
borrow_loc x
// we are capturing a reference
pack_closure g, 1
ret
public fun g(x: &u64): u64
move_loc x
read_ref
ret
public fun h(): u64
call f
call_closure<|&u64|u64>
ret
//# run --verbose
script
use 0xc0ffee::m
fun main()
call m::h
pop
ret
If we turn off the static bytecode verifier, then the paranoid mode does not check that references are captured when packing a closure. Instead, we get an invariant violation error in type layout converter.