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

Imprecise error location when a submodule does not implement its signature #7859

vicuna opened this issue Oct 7, 2018 · 3 comments


None yet
2 participants
Copy link

commented Oct 7, 2018

Original bug ID: 7859
Reporter: @samoht
Status: new
Resolution: open
Priority: normal
Severity: minor
Version: 4.07.1
Category: typing
Monitored by: @nojb

Bug description

The location (and the message) for type errors regarding module not implementing a required signature is sometimes not very helpful. For instance when the signature is defined in an other module, the error message points to that other module instead of the implementation:

$ cat foo.mli
val x: int

module X: Map.OrderedType
$ cat
let x = 2

module X = struct end
$ ocamlc -c foo.mli
File "", line 1:
Error: The implementation does not match the interface foo.cmi:
       In module X:
       Modules do not match: sig  end is not included in Map.OrderedType
       In module X:
       The value `compare' is required but not provided
       File "map.mli", line 51, characters 4-31: Expected declaration
       In module X:
       The type `t' is required but not provided
       File "map.mli", line 48, characters 4-10: Expected declaration

The error message refers to map.mli which is not helpful here. No error message points me to the actual module X in the file which needs to be corrected.


This comment has been minimized.

Copy link

commented Oct 7, 2018

Comment author: @samoht

(I have assigned the wrong Category to that issue but it seems that I cannot edit it... sorry about this)


This comment has been minimized.

Copy link

commented Oct 10, 2018

Comment author: @alainfrisch

(Moved to the "typing" category.)

@vicuna vicuna added the typing label Mar 14, 2019


This comment has been minimized.

Copy link

commented Mar 15, 2019

I think (though I'm not sure) that this would have been fixed by #1737 , which unfortunately was reverted in #2092 because of issue #7852 .

I'm planning to have another stab at that issue very soon.

@trefis trefis self-assigned this Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.