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

Wrong result on a function named 'unit' #1109

Closed
Julow opened this issue Mar 4, 2020 · 3 comments
Closed

Wrong result on a function named 'unit' #1109

Julow opened this issue Mar 4, 2020 · 3 comments
Labels

Comments

@Julow
Copy link
Contributor

Julow commented Mar 4, 2020

Hi,

let rec unit x = x

and f : Unknown_module.t -> _ =
 fun x -> x

let g x = unit x

In this file, asking :MerlinTypeOf on any of the two unit occurrences gives:

type unit = ()

This happens only if Unknown_module is not found.

voodoos added a commit to voodoos/merlin that referenced this issue Mar 9, 2020
voodoos added a commit to voodoos/merlin that referenced this issue Apr 9, 2020
voodoos added a commit to voodoos/merlin that referenced this issue Apr 9, 2020
voodoos added a commit to voodoos/merlin that referenced this issue May 28, 2020
@trefis
Copy link
Contributor

trefis commented Sep 22, 2020

@voodoos can you give an update on the status of this one?

@voodoos
Copy link
Collaborator

voodoos commented Sep 22, 2020

I would say it is mostly fixed ?

https://github.com/ocaml/merlin/tree/master/tests/test-dirs/type-enclosing/recovery

Merlin gives two answers, the first one is correct, the second not really:


  $ $MERLIN single type-enclosing -position 5:11 -verbosity 0 \
  > -filename ./issue1109.ml < ./issue1109.ml | jq ".value[0:2]"
  [
    {
      "start": {
        "line": 5,
        "col": 10
      },
      "end": {
        "line": 5,
        "col": 14
      },
      "type": "'a -> 'b",
      "tail": "no"
    },
    {
      "start": {
        "line": 5,
        "col": 10
      },
      "end": {
        "line": 5,
        "col": 16
      },
      "type": "'a",
      "tail": "no"
    }
  ]

@trefis
Copy link
Contributor

trefis commented Sep 22, 2020

Meh.
But yeah, let's close this for now. This should get better with a better recovery.

@trefis trefis closed this as completed Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants