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

Missing warnings with OCaml 4.02.1 on Emacs #343

Closed
dhekir opened this issue Jan 13, 2015 · 2 comments
Closed

Missing warnings with OCaml 4.02.1 on Emacs #343

dhekir opened this issue Jan 13, 2015 · 2 comments

Comments

@dhekir
Copy link

dhekir commented Jan 13, 2015

I'm having some issues similar to #254, but related to other warnings.

Using OCaml 4.02.1, I tried with merlin 2.0.0 and also with the master branch, but could not get some warnings to be emitted by merlin.

Consider the following code:

let f x y = x

let f (t : Genlex.token) = match t with | Ident _ -> 1 | _ -> 0

When running ocamlc -w +a, I get:

File "test.ml", line 3, characters 42-47:
Warning 40: Ident was selected from type Genlex.token.
It is not visible in the current scope, and will not
be selected if the type becomes unknown.
File "test.ml", line 3, characters 42-47:
Warning 42: this use of Ident required disambiguation.
File "test.ml", line 3, characters 27-63:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type Genlex.token.
File "test.ml", line 3, characters 27-63:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type Genlex.token.
File "test.ml", line 1, characters 4-5:
Warning 32: unused value f.
File "test.ml", line 1, characters 8-9:
Warning 27: unused variable y.

Then I ran merlin inside Emacs on a directory containing the following .merlin:

FLG -w +a

The only warning I get (twice) is:

Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type Genlex.token.

Warnings 27, 32, 40 and 42 were not printed.

Did I do something wrong? I even tried hardcoding flags "-w" "+a" directly on emacs/merlin.el, but to no avail.

@let-def
Copy link
Contributor

let-def commented Feb 2, 2015

Those warnings are checked in a later pass in usual ocaml compiler, which is not really implemented in merlin pipeline.

This can be improved, but require some fundamental reorganization.

@dhekir
Copy link
Author

dhekir commented Feb 3, 2015

Oh, I see, I suspected it might be more complex than I expected. I mostly wanted to make sure I had not misconfigured things in my side.
Thank you for the information. Ocamlmerlin is already extremely useful as it is already. I'll try and think of some emacs-lisp code to help me get the warnings.

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

No branches or pull requests

2 participants