error comptime-error
Ошибка при вычислении на этапе компиляции.
What it means#
Code that runs at compile time (const, comptime blocks and functions) failed: a panic, a division by zero, an overflow or a failing contract (§15.1). The error is reported at the compile-time expression. Compile-time code is deterministic, so it fails on every build.
Example#
data P {
x: i32
}
fn main() io {
print(reflect(P).colour) // <- comptime-error (P has no member `colour`)
}error
comptime-error
How to fix#
data P {
x: i32
}
fn main() io {
print(reflect(P).name)
}Fix the computation. For a value that is only known at run time, use let or config instead of const.