E0026: invalid hexadecimal literal

View source

A hexadecimal literal is 0x, then at least one hex digit, then an optional width suffix such as u8 or i32.

A hexadecimal literal is 0x, then at least one hex digit, then an optional width suffix such as u8 or i32. The lexer rejects a literal with no digits, such as 0xu8, and a literal that ends in anything else, such as 0x12G or 0xFFu. The 0x prefix is only a way to write a number, and the suffix alone gives the type. ADR-0026 keeps the literal format apart from the type system, and ADR-0052 defines the typed suffix. Before ADR-0123 this error was reported as E0005, which is also a parser code.

Example

actus
verb main() {
    erg mask = 0x12G;
}

Fix

Write only hex digits, and add a valid width suffix if the literal needs one.

actus
verb main() {
    erg mask = 0x12;
}

Run actus explain E0026 in your terminal to read this entry offline. Browse Lexer & parser or all error codes.