Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006380OCamltypingpublic2014-04-25 03:432017-03-14 09:52
Assigned Tolpw25 
PlatformOSOS Version
Product Version4.01.0 
Target VersionundecidedFixed in Version 
Summary0006380: -short-paths sometimes does not shorten paths
DescriptionWhen 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
module Std = struct
  type t
$ ocamlopt -c -short-paths
$ cat b2.mli
open A.Std
val a : unit -> t
$ ocamlopt -c -short-paths b2.mli
$ cat
open A.Std
let a = ()
$ ocamlopt -c -short-paths
File "", line 1:
Error: The implementation 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 "", line 2, characters 4-5: Actual declaration
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2014-06-04 21:51

reproduced on 4.02.0+dev
lpw25 (developer)
2017-03-14 09:52

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:

    open A.Std
    val a : unit -> t

rather than:

    val a : unit -> A.Std.t

and similarly it would allow `t` to be used in the error message.

- Issue History
Date Modified Username Field Change
2014-04-25 03:43 sliquister New Issue
2014-06-04 21:51 doligez Note Added: 0011658
2014-06-04 21:51 doligez Target Version => 4.03.0+dev / +beta1
2014-07-16 16:09 doligez Status new => confirmed
2016-04-05 15:11 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-23 16:45 doligez Category OCaml typing => typing
2017-03-14 09:08 garrigue Assigned To => lpw25
2017-03-14 09:08 garrigue Status confirmed => assigned
2017-03-14 09:52 lpw25 Note Added: 0017643
2017-03-14 09:52 lpw25 Severity minor => feature

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker