Lyricdev
GitHub

LYR-PAR0007

a numeric literal too large

error ยท spec 01-lexical

An integer literal does not fit in 64 bits, or a float literal is beyond the range of float.

Explanation

An integer literal is at most 64 bits wide, 18446744073709551615 the largest; a float literal is at most the largest finite float. A literal beyond that has no type to hold it.

Write a smaller value; for numbers beyond 64 bits, use a type built for them.

Wrong

fn main(): void {
    let big = 18446744073709551616;
}
fn main(): void {
    let big = 18446744073709551615u64;
    let _ = big;
}