E0052
Call of a function that does not exist
ErrorA call must name a function of the program, a class, a prelude function (print, eprint, panic, read_line), or a conversion i64(...), u8(...), f64(...), char(...) or string(...).
When a function, class, prelude function or conversion has a similar name, or another language's name for one, such as readln or input, the error offers it as an unsafe fix. The unsafe fix may be wrong: the name could be a function that was never written.
Why
Sisu does not resolve a misspelled function name on its own. A misspelled name, or a function that was never written, would otherwise run some other code or none.
Broken
fn total(a: i64, b: i64) -> i64 {
a + b
}
fn main() {
print(sum(1, 2))
}
What sisu says
error[E0052]: cannot find function `sum` --> E0052.sisu:6:11 | 6 | print(sum(1, 2)) | ^^^ sisu: 1 error sisu: for more on a code, run `sisu explain <code>`: E0052
Fixed
fn total(a: i64, b: i64) -> i64 {
a + b
}
fn main() {
print(total(1, 2))
}
Related
- E0033: a name that is not in scope.
Sisu