Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006311OCamlOCaml typingpublic2014-01-29 21:272015-03-25 00:30
Assigned Tofrisch 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version4.02.0+dev 
Summary0006311: Improve signature mismatch error messages
Description1) It would be nice for the error message to indicate which kind of field is missing (type, value, module) in case of signature mismatch.

Here's an example, of course it's obvious here since the sig is small but sometimes one forgets that there are two fields with the same name of different kind and you wonder for a little while about the error message as you actually contemplate the other field in your implementation.

module M : sig
  type bla
  val bla : bla
end = struct
  let bla = ()

File "", line 5, characters 6-31:
Error: Signature mismatch:
       Modules do not match:
         sig val bla : unit end
       is not included in
         sig type bla val bla : bla end
       The field `bla' is required but not provided

2) One other thing that would be nice is to output further error messages for each missing field that points to the definition in the signature so that we can quickly jump to the def of what is missing.



TagsNo tags attached.
Attached Files

- Relationships

-  Notes
dbuenzli (reporter)
2014-01-29 21:31

Just to add, in fact when your module is large the signature is eluded in the error message, so here 2) would be really nice:

File "src/", line 1:
Error: The implementation src/
       does not match the interface src/lit.cmi:
       In module Prog:
       The field `source' is required but not provided
frisch (developer)
2014-01-30 10:56

Commit 14427 on trunk adds the requested information (kind + location of missing items) to the error message. The location is currently not available for module and module type items.
frisch (developer)
2014-01-30 13:18

Commit 14428 adds location for module and module type items.
dbuenzli (reporter)
2014-01-30 13:33

Wow, that was quick. Thanks Alain.
dbuenzli (reporter)
2015-03-25 00:30

I still get unprecise errors reports here's an example:

File "src/", line 1:
Error: The implementation src/
       does not match the interface src/reach.cmi:
       At position
         module Private :
           sig module Store : sig module type S = <here> end end
       The value `writer_close' is required but not provided
Command exited with code 2.
dbuenzli (reporter)
2015-03-25 00:30

(On 4.02.1)

- Issue History
Date Modified Username Field Change
2014-01-29 21:27 dbuenzli New Issue
2014-01-29 21:31 dbuenzli Note Added: 0010862
2014-01-30 10:15 frisch Assigned To => frisch
2014-01-30 10:15 frisch Status new => assigned
2014-01-30 10:56 frisch Note Added: 0010863
2014-01-30 13:18 frisch Note Added: 0010864
2014-01-30 13:21 frisch Status assigned => resolved
2014-01-30 13:21 frisch Fixed in Version => 4.02.0+dev
2014-01-30 13:21 frisch Resolution open => fixed
2014-01-30 13:33 dbuenzli Note Added: 0010866
2015-03-25 00:30 dbuenzli Note Added: 0013537
2015-03-25 00:30 dbuenzli Note Added: 0013538
2015-03-25 00:30 dbuenzli Status resolved => feedback
2015-03-25 00:30 dbuenzli Resolution fixed => reopened

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker