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
struct Wrapper<T: copy> has drop, key, store, copy {
inner: T
}
fun unwrap<T: copy>(self: &Wrapper<T>): T {
self.inner
}
fun dispatch<T: copy>(account: address): T acquires Wrapper {
unwrap(&Wrapper<T>[account])
}
The following bytecode verification error is generated:
bug: bytecode verification failed with unexpected status code `CONSTRAINT_NOT_SATISFIED`. This is a compiler bug, consider reporting it.
Error message: missing abilities for `ImmBorrowGlobalGeneric(StructDefInstantiationIndex(0))` at code offset 1
If we change unwrap(&Wrapper<T>[account]) into unwrap(borrow_global<Wrapper<T>>), the following error is generated:
error: type `T` is missing required ability `store`
┌─ TEMPFILE:298:23
│
298 │ borrow_global<Wrapper<T>>(account).unwrap()
│ ^^^^^^^^^^
│
The text was updated successfully, but these errors were encountered:
🐛 Bug
When compiling the following code,
The following bytecode verification error is generated:
If we change
unwrap(&Wrapper<T>[account])
intounwrap(borrow_global<Wrapper<T>>)
, the following error is generated:The text was updated successfully, but these errors were encountered: