Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006311OCamlOCaml typingpublic2014-01-29 21:272014-01-30 13:33
Reporterdbuenzli 
Assigned Tofrisch 
PrioritynormalSeveritytweakReproducibilityalways
StatusresolvedResolutionfixed 
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 = ()
end

File "test.ml", 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.

Thanks,

Daniel


TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0010862)
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/lit.ml", line 1:
Error: The implementation src/lit.ml
       does not match the interface src/lit.cmi:
       ...
       In module Prog:
       The field `source' is required but not provided
(0010863)
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.
(0010864)
frisch (developer)
2014-01-30 13:18

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

Wow, that was quick. Thanks Alain.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker