ocaml / ocaml-lsp

OCaml Language Server Protocol implementation
Other
747 stars 117 forks source link

type aliases weird behavior #1227

Open puitgfr opened 7 months ago

puitgfr commented 7 months ago

Type aliases seem to be incorrectly displayed. Here is a short (working) example in codium with a type alias for natural numbers and a factorial function: defining nat type alias and factorial function So far, so good. Now, let's add an increment function on integers: nat_2 Maybe I'm missing something about type aliases, but I 'd like the type annotation of incr to show int -> int.

PizieDust commented 6 months ago

Okay, I just tried to replicate the above. It seems to be an issue with int aliases. I changed the type to float and incr displays the "expected" type:

image
voodoos commented 6 months ago

Okay, I just tried to replicate the above. It seems to be an issue with int aliases. I changed the type to float and incr displays the "expected" type:

image

@PizieDust you have to replace occurences of int by float on line 6 too.

This is probably due to short-path and is a Merlin issue.

PizieDust commented 6 months ago

@PizieDust you have to replace occurences of int by float on line 6 too.

Yes changing it to float, replicates the problem.