Lyricdev
GitHub

LYR-LEX0005

a digit separator right after a base prefix

error ยท spec 01-lexical

A literal with a base prefix has _ directly after the prefix, as in 0x_FF.

Explanation

_ separates digits, so it stands between two of them; directly after 0x, 0o or 0b it separates nothing.

Drop the _ after the prefix; between digits it may stay, 0xFF_FF.

Wrong

fn main(): void {
    let x = 0x_FF;
    let _ = x;
}
fn main(): void {
    let x = 0xFF_FF;
    let _ = x;
}