Skip to content

Add warnings for partial functions #234

Open

Description

@Krzysztof-Cieslak

Add warnings for partial functions such as List.head or Option.get

Activity

  1. jgardella commented on Jun 8, 2020

    @jgardella
    Contributor

    I think this is a good addition, in my experience a lot of bugs can arise through using partial functions, and in most cases you shouldn't be using them when writing idiomatic F#.

    My initial thought was that this could be achieved by adding hints, and it can to some degree, but with a dedicated rule we could also make use of typechecking information to check for instances of optionVar.Value and similar usages.

  2. added this to the Version 1.0.0 milestone on Jun 8, 2020
  3. duckmatt commented on Jun 10, 2020

    @duckmatt
    Collaborator

    It would be quite cool if the hints allow you to specify the type of a variable, that would enable this to be done via hints and enable other rules like unnecessary casts etc to be done via hints

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions