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
-short-paths sometimes does not shorten paths #6380
Comments
Comment author: @damiendoligez reproduced on 4.02.0+dev |
Comment author: @lpw25 I've marked this as a feature because it is not actually a bug. The issue is that those open statements are inside the module. So they are not in the environment when we do the comparison and print the error. If we want to make this work I think we need to have open statements be included in module types. They would only affect printing -- much like the names attached to type variables and similar. This would allow the module type to be printed as: sig rather than: sig and similarly it would allow |
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. |
This probably still worth fixing. Maybe @Octachron would be interested in it since he's done a lot to improve the error printing. |
I didn't but it could be considered, yes. |
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. |
Original bug ID: 6380
Reporter: @sliquister
Assigned to: @lpw25
Status: assigned (set by @garrigue on 2017-03-14T08:08:21Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.01.0
Target version: undecided
Category: typing
Monitored by: @hcarty
Bug description
When type errors happen while matching a .ml against with its interface, -short-paths seems to have no effect.
In the type error below, I'd expect to see "val a : unit -> t" instead of "val a : unit -> A.Std.t".
Steps to reproduce
$ cat a.ml
module Std = struct
type t
end
$ ocamlopt -c -short-paths a.ml
$ cat b2.mli
open A.Std
val a : unit -> t
$ ocamlopt -c -short-paths b2.mli
$ cat b2.ml
open A.Std
let a = ()
$ ocamlopt -c -short-paths b2.ml
File "b2.ml", line 1:
Error: The implementation b2.ml does not match the interface b2.cmi:
Values do not match:
val a : unit
is not included in
val a : unit -> A.Std.t
File "b2.ml", line 2, characters 4-5: Actual declaration
The text was updated successfully, but these errors were encountered: