Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004791OCamlOCaml generalpublic2009-05-15 12:212013-07-24 22:33
Reporterjerhoud 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version3.10.2 
Target Version4.01.1+devFixed in Version 
Summary0004791: ocamlc -i produces incorrect result
Description> cat a.ml

(* begin of a.ml *)
type t = A
  
module B =
struct
  type t = B
    
  let f A = B
end
(* end of a.ml *)

> ocamlc -i a.ml

type t = A
module B : sig type t = B val f : t -> t end

The type of f is incorrect, it should be something like "val f : A.t -> B.t" except that there seems to be no way of actually writing a correct signature for module B (both A.t and B.t are unbound at this stage).

On the other hand, other definitions using f seem to be typed correctly.

I may admit that there is no way to solve this problem, but ocamlc -i should report an error instead of producing an incorrect result.

TagsNo tags attached.
Attached Files? file icon a.ml [^] (106 bytes) 2009-05-15 12:21 [Show Content]

- Relationships

-  Notes
(0007496)
garrigue (manager)
2012-06-01 09:42

Scoping of types in signatures is unfortunately a problem with no easy solution.
This is just one of its instances.

Note that unification errors involving several types with the same name result in printing internal ids to distinguish them.

- Issue History
Date Modified Username Field Change
2009-05-15 12:21 jerhoud New Issue
2009-05-15 12:21 jerhoud File Added: a.ml
2009-05-15 17:09 doligez Status new => acknowledged
2012-06-01 09:42 garrigue Note Added: 0007496
2012-07-11 14:51 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-17 14:05 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-07-24 22:33 doligez Target Version 4.01.0+dev => 4.01.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker