E1072: pack field extends past the storage

View source

Each field covers the bits from its at offset up to the offset plus its width, and all of them must lie inside the backing store (ADR-0026).

Each field covers the bits from its at offset up to the offset plus its width, and all of them must lie inside the backing store (ADR-0026). A field that ends beyond the last bit is rejected before any code is generated. The message gives the offset, the width and the capacity in bits. The error points at the field.

Example

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg enabled: u1 at 0;
        abs _reserved: u8 at 1 = 0;
    }
}

verb main() {
}

Fix

Shrink the field or move it, or choose a larger store.

actus
pack Flags {
    erg storage: u8;
    layout little;
    fields {
        erg enabled: u1 at 0;
        abs _reserved: u7 at 1 = 0;
    }
}

verb main() {
}

Run actus explain E1072 in your terminal to read this entry offline. Browse Ownership & types or all error codes.