-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve signature mismatch error messages #6311
Description
Original bug ID: 6311
Reporter: @dbuenzli
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2016-12-07T10:48:53Z)
Resolution: fixed
Priority: normal
Severity: tweak
Version: 4.01.0
Fixed in version: 4.02.0+dev
Category: typing
Monitored by: @dbuenzli
Bug description
- 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
- 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