Skip to content

Occurrences of None returns invalid matches from default parameter #1410

@mattiase

Description

@mattiase

Consider the file:

(* test case *)
let f ?(x=1) () = 2 ;;
None

Occurrences on the location of None returns a match at that same position as well as one at an invalid position (line 0, column -1). It appears to be linked to the default argument somehow.

Of course we can filter out matches at invalid positions, either in merlin proper or in whatever code making use of the output (like the Emacs lisp code), but it would be better to to generate them in the first place. Maybe there are more such cases that become apparent if the source of them is found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions