Lyricdev
GitHub

LYR-RT0011

a failed assertion

panic ยท spec 06-errors

assert(condition) found its condition false. The message names the condition as written and, when the assertion has one, the message its lambda builds on failure.

Program

fn main(): void {
    let xs = [1, 2, 3];
    assert(xs.length() == 4) { f"{xs.length()} elements" };
}