Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006416OCamltypingpublic2014-05-13 00:442017-03-23 18:12
Reporterdwang 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
Platformx86 64-bitOSLinux CentOS 6OS Version2.6.32-358.23.2.
Product Version4.01.0 
Target VersionFixed 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 = ()
  end
end

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 = ()
  end
end
TagsNo tags attached.
Attached Files

- Relationships
related to 0004791acknowledged ocamlc -i produces incorrect result 

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

I think this is a fairly long-standing problem, which we should look at after 4.02.
(0011612)
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.
(0017693)
octachron (developer)
2017-03-23 18:12
edited on: 2017-03-23 18:12

I have a proposition to extend the mechanism used for unification errors to print unambiguous identifier names in various error and warning messages in the PR https://github.com/ocaml/ocaml/pull/1120 [^] .


- 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 / +beta1
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
2016-04-05 14:52 doligez Status acknowledged => confirmed
2016-04-05 14:52 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:06 garrigue Relationship added related to 0004791
2017-03-14 09:06 garrigue Relationship deleted related to 0006323
2017-03-15 11:34 doligez Target Version undecided =>
2017-03-23 18:12 octachron Note Added: 0017693
2017-03-23 18:12 octachron Note Edited: 0017693 View Revisions


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker