Interpreter
Interpreter copied to clipboard
Add analyzer check for ignored Result types with expression statements
Expression statements currently discard the return value. For functions that return Results, this can result in errors (exceptions) being unintentionally dropped. The likelihood of this is increased due to automatic Result conversions, since a function that throws exceptions like parse! could accidentally be called as parse.
Languages like Rust, for instance, have more advanced solutions to this for determining whether the return value of any function can be ignored. This is a more complex overhaul, so for now special-casing this to Result seems to be a fair balance.