Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004709OCamlOCaml generalpublic2009-02-05 14:492014-07-31 17:28
ReporterJulien Signoles 
Assigned To 
Platformx86OSLinux UbuntuOS Version
Product Version3.11.0 
Target VersionlaterFixed in Version 
Summary0004709: Typing of recursive modules to permissive

I guess that the following program should not be typable, but it is with ocaml 3.11.0 and 3.10.2. It was not typable with ocaml 3.10.0.

module F(X:sig type t end) = struct type t = X.t end

module rec A : sig type t end = struct type t = int end
and B: sig type t = int end = F(A)

It seems that the explicit signature of A (with t abstract) is not used for typing B. Instead, that the inferred signature of A (with t = int) which is used. Thus program abstraction is broken.

Whenever I give a wrong type to the signature of B (e.g. type t = float), the program does not typed. So type safety is not broken. Ouf :).
Additional InformationThe given program does not compile with ocaml 3.10.0 (don't try for ocaml 3.10.1). The expected error message is given.

Signature mismatch:
Modules do not match:
  sig type t = A.t end
is not included in
  sig type t = int end
Type declarations do not match: type t = A.t is not included in type t = int
Attached Files

- Relationships
related to 0004336closedxleroy Recursive modules can be used to break type safety 

-  Notes
Julien Signoles (reporter)
2009-02-05 14:51

Seem to be related to the fix of bug 4336 (which was: "Recursive modules can be used to break type safety").
xleroy (administrator)
2009-03-28 17:00

I'm unsure how to go about this issue. I'm afraid it will stay for a while :-(
xleroy (administrator)
2012-08-06 18:24

I've been sleeping on these PR for too long, and still have no idea how to address them. Unassigning them from myself.

- Issue History
Date Modified Username Field Change
2009-02-05 14:49 Julien Signoles New Issue
2009-02-05 14:51 Julien Signoles Note Added: 0004832
2009-03-28 17:00 xleroy Note Added: 0004872
2009-03-28 17:00 xleroy Assigned To => xleroy
2009-03-28 17:00 xleroy Status new => assigned
2012-07-11 14:59 doligez Target Version => 4.01.0+dev
2012-07-29 18:00 frisch Relationship added related to 0004336
2012-07-29 18:01 frisch Tag Attached: recmod
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-08-06 18:22 xleroy Target Version 4.00.1+dev => 4.01.0+dev
2012-08-06 18:24 xleroy Note Added: 0007911
2012-08-06 18:25 xleroy Assigned To xleroy =>
2012-08-06 18:25 xleroy Status assigned => acknowledged
2013-07-24 22:30 doligez Target Version 4.01.0+dev => 4.01.1+dev
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-07-31 17:28 doligez Target Version 4.02.0+dev => later

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker