E1071: pack field has a type that is not an integer

View source

The width of a pack field comes from its type, so the type must be an integer such as u1, u8 or i16, or an Array of integers with a literal count.

The width of a pack field comes from its type, so the type must be an integer such as u1, u8 or i16, or an Array of integers with a literal count. A Bool, a struct or an array with a computed count has no bit width that the layout can place. The message names the field, the pack and the type. The error points at the type.

Example

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

verb main() {
}

Fix

Use an integer type of the width that the field needs. A one-bit flag is u1.

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 E1071 in your terminal to read this entry offline. Browse Ownership & types or all error codes.