Error codes

E0420: imprint panicked at compile time

In a terminal: auk explain E0420 prints this page.

On this page

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#

auk
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#

auk
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 int overflows.
  • 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.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page