An imprint is computed when the program is compiled (by auk run, build, test and
ir), not when it runs. Computing this one panicked: an integer overflowed, an index was out of
range, a requires failed, a hole was reached... The error shows the panic and where it
happened. auk check doesn't compute imprints, so it doesn't report this.
Wrong#
fn fact(n: int): int = if n == 0 { 1 } else { n * fact(n - 1) }
imprint FACTS = (0..=25).map(n => fact(n))
fn main() { print(FACTS) }Fixed#
fn fact(n: int): int = if n == 0 { 1 } else { n * fact(n - 1) }
imprint FACTS = (0..=20).map(n => fact(n))
fn main() { print(FACTS) }Common causes#
- Integer overflow in a table that grows fast (factorials, powers): stop before
intoverflows. - An index or key computed off by one while building the table.
- A
??hole or!on a missing value inside a function the imprint calls.