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

Merlin infers wrong types for labelled optional arguments in 5.2 #2737

Closed
jchavarri opened this issue May 23, 2024 · 0 comments · Fixed by #2753
Closed

Merlin infers wrong types for labelled optional arguments in 5.2 #2737

jchavarri opened this issue May 23, 2024 · 0 comments · Fixed by #2753

Comments

@jchavarri
Copy link
Contributor

@anmonteiro and myself have been debugging some issues that surfaced in reason-react test suite when upgrading to 5.2: reasonml/reason-react#833.

It seems that when using 3.11.0 with OCaml 5.2, the type signature inferred from a function like:

let t = (~foo=0, ()) => foo;

The inferred type signature in merlin / lsp will be:

(~foo: int, unit) => int

when it should be:

(~foo: int=?, unit) => int

Some of the things we've gathered:

  • The error affects the editor tooling, but not actual compilation
  • It only happens when using 3.11.0 with 5.2, but the behavior is right when using it with 5.1
  • The issue is not reproducible when using OCaml syntax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant