Lyricdev
GitHub

LYR-RT0002

integer overflow

panic ยท spec 03-types

An integer operation's result does not fit its type: +, -, *, unary -, MIN / -1 and MIN % -1, or a shift by a count outside 0 to the width minus one. Arithmetic is checked in every built-in profile; the library's wrapping operations are there where wrapping is meant.

Program

fn add(a: int, b: int): int {
    return a + b;
}

fn main(): void {
    assert(add(9223372036854775807, 1) > 0);
}