Compiling the following Move code with V2 compiler
module demo::demo {
struct S<T: store> has store {
field: T,
}
struct E<T: store> has store, drop {
entry: S<T>,
}
}
yields an error at the File Format generation phase:
bug: bytecode verification failed with unexpected status code `FIELD_MISSING_TYPE_ABILITY`. This is a compiler bug, consider reporting it.
โโ /<redacted>/test/sources/test.move:1:1
โ
1 โ โญ module demo::demo {
2 โ โ struct S<T: store> has store {
3 โ โ field: T,
4 โ โ }
ยท โ
8 โ โ }
9 โ โ }
โ โฐโ^
Which is a bit late in the process.
With V1 compiler, the error message is more dev-friendly:
error[E05001]: ability constraint not satisfied
โโ /<redacted>/test/sources/test.move:7:16
โ
2 โ struct S<T: store> has store {
โ - To satisfy the constraint, the 'drop' ability would need to be added here
ยท
7 โ entry: S<T>,
โ ^^^^
โ โ
โ Invalid field type. The struct was declared with the ability 'drop' so all fields require the ability 'drop'
โ The type '(demo=0x97751FCABB9A35CABA546D45C30E91CEB8B4622386C2DBF81B9B6D64A9F53AEF)::demo::S<_>' does not have the ability 'drop'
This is the bytecode verifier as a verification step after code generation, and any error like this is definitely an unintended bug, though safe because the code can't be deployed.
๐ Bug
Compiling the following Move code with V2 compiler
yields an error at the File Format generation phase:
Which is a bit late in the process.
With V1 compiler, the error message is more dev-friendly: