Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006416OCamlOCaml typingpublic2014-05-13 00:442014-05-31 16:06
Assigned To 
Platformx86 64-bitOSLinux CentOS 6OS Version2.6.32-358.23.2.
Product Version4.01.0 
Target Version4.03.0+devFixed in Version 
Summary0006416: The same string can mean different types in the same error message
DescriptionCompile this code:

module M = struct
  type t = A
  module M : sig
    val f : t -> unit
  end = struct
    type t = B
    let f B = ()

The error is

Values do not match: val f : t -> unit is not included in val f : t -> unit
Line 4, characters 4-21: Expected declaration
Line 7, characters 8-9: Actual declaration

I would prefer the error to be more explicit that there are two
different types here both named 't'.
Steps To ReproduceCompile this code:

module M = struct
  type t = A
  module M : sig
    val f : t -> unit
  end = struct
    type t = B
    let f B = ()
TagsNo tags attached.
Attached Files

- Relationships
related to 0006323acknowledged ocamlc -i can generate a wrong signature 

-  Notes
shinwell (developer)
2014-05-30 12:42

I think this is a fairly long-standing problem, which we should look at after 4.02.
garrigue (manager)
2014-05-31 16:06

As a side note, this problem is already solved for unification errors: in that case, the internal id for each type is printed. This is not done yet for module coercion errors, but shouldn't be more difficult.

- Issue History
Date Modified Username Field Change
2014-05-13 00:44 dwang New Issue
2014-05-16 17:47 doligez Target Version => 4.03.0+dev
2014-05-30 12:42 shinwell Note Added: 0011589
2014-05-30 12:42 shinwell Status new => acknowledged
2014-05-30 14:14 shinwell Relationship added related to 0006323
2014-05-31 16:06 garrigue Note Added: 0011612

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker