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

Closed
vicuna opened this issue Oct 7, 2018 · 11 comments
Closed
Assignees

Comments

@vicuna
Copy link

vicuna 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 foo.ml
let x = 2

module X = struct end
$ ocamlc -c foo.mli foo.ml
File "foo.ml", line 1:
Error: The implementation foo.ml 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 foo.ml which needs to be corrected.

@vicuna
Copy link
Author

vicuna 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)

@vicuna
Copy link
Author

vicuna commented Oct 10, 2018

Comment author: @alainfrisch

(Moved to the "typing" category.)

@vicuna vicuna added the typing label Mar 14, 2019
@trefis
Copy link
Contributor

trefis 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.

@github-actions
Copy link

github-actions bot commented May 7, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 7, 2020
@Drup
Copy link
Contributor

Drup commented May 7, 2020

@trefis What's the status of resubmitting #1737 ?

@trefis
Copy link
Contributor

trefis commented May 7, 2020

See #7852 (comment)

@trefis trefis removed the Stale label May 7, 2020
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 10, 2021
@gasche
Copy link
Member

gasche commented May 10, 2021

I'm not sure what the status of this issue here; @trefis ?

@trefis
Copy link
Contributor

trefis commented May 10, 2021

#10405

@github-actions github-actions bot removed the Stale label May 12, 2021
@Octachron
Copy link
Member

In this case, #10405 does not change the error message, mostly because it is already pointing to the module X:

      In module X:
      Modules do not match: sig  end is not included in Map.OrderedType
      In module X:

I would propose to highlight the module context (here X) and add some indentation, which should be fine once we limit the number of pair (context,module type) which is printed in the same error message.

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Jul 1, 2022
@github-actions github-actions bot closed this as completed Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants