The call can fail, and its result is thrown away, so its error would vanish silently. Auk
requires every error to be handled visibly: pass it up with ?, handle it with else, or
discard it explicitly with let _ =.
Wrong#
fn save(): ()! = ()
fn main(): ()! {
save()
print("saved")
}Fixed#
fn save(): ()! = ()
fn main(): ()! {
save()?
print("saved")
}Common causes#
- Calling
fs.write,fs.removeor another fallible function as a statement. - Deliberately ignoring an error: write
let _ = save()so the choice is visible.