Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add analyzer check for ignored Result types with expression statements #30

Open
WillBAnders opened this issue Jun 23, 2023 · 0 comments

Comments

@WillBAnders
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant