Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007859OCamltypingpublic2018-10-07 12:592018-10-10 14:49
Reportersamoht 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version4.07.1 
Target VersionFixed in Version 
Summary0007859: Imprecise error location when a submodule does not implement its signature
DescriptionThe 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:

```sh
$ 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0019403)
samoht (reporter)
2018-10-07 13:29

(I have assigned the wrong Category to that issue but it seems that I cannot edit it... sorry about this)
(0019411)
frisch (developer)
2018-10-10 14:49

(Moved to the "typing" category.)

- Issue History
Date Modified Username Field Change
2018-10-07 12:59 samoht New Issue
2018-10-07 13:29 samoht Note Added: 0019403
2018-10-10 14:49 frisch Category middle end (typedtree to clambda) => typing
2018-10-10 14:49 frisch Note Added: 0019411


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker