Skip to content

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

Description

@WillBAnders

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions