Sisu
E0037

return with a value in a function that returns none

Error

Built from the repository at commit a8614dc.

A function without a return type returns no value, so its return stands alone.

Why

The caller of such a function has no value to receive. Declare a return type, such as -> i64, to return one.

Broken

fn show() {
    return 5
}

fn main() {
    show()
}

What sisu says

error[E0037]: this function returns no value
 --> E0037.sisu:2:12
  |
2 |     return 5
  |            ^

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0037

Fixed

fn show() {
    print(5)
    return
}

fn main() {
    show()
}