Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005006OCamltypingpublic2010-03-22 14:092017-03-14 10:36
Reporterfrisch 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionlaterFixed in Version 
Summary0005006: Typing problem with recursive modules
DescriptionThe following is rejected:

module rec X : sig
  type t
  module type S = sig val x: t end
end = struct
  type t
  module type S = X.S
end

Same for "val x: X.t" instead of "val x: t".

But if we replace X.S with "sig include X.S end", then it works fine.

Is it the expected behavior?

Are there cases where replacing a reference to a signature S by "sig include S end" breaks code?
Tagsrecmod
Attached Files

- Relationships

-  Notes
(0007908)
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.
(0007923)
frisch (developer)
2012-08-06 22:54

Xavier: do you have an opinion about the "S -> sig include S end" rewriting? Do you understand why it makes this code type-checks? Could this be applied systematically, or could it break something?
(0017641)
garrigue (manager)
2017-03-14 09:21

There is no specification of recursive modules, so this is not a bug :-)
(0017642)
frisch (developer)
2017-03-14 09:40

This is a slippery slope (even with the smiley). I understand the feature is experimental, but as far as I know, the lack of specification is a property of the entire system, not just of this feature.
(0017644)
garrigue (manager)
2017-03-14 10:36

There is no formal specification of OCaml, but there is an intended behavior, and some people have even provided formal specification for parts of it.
But recursive modules explicitly lack a specification. So they really differ from the rest of the language. (To be precise, some subtle interactions between polymorphic variants and modules/first class polymorphism are unspecified too)

- Issue History
Date Modified Username Field Change
2010-03-22 14:09 frisch New Issue
2010-05-28 17:24 frisch Status new => assigned
2010-05-28 17:24 frisch Assigned To => xleroy
2012-06-20 11:15 frisch Category OCaml general => OCaml typing
2012-07-10 20:30 doligez Target Version => 4.01.0+dev
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: 0007908
2012-08-06 18:27 xleroy Assigned To xleroy =>
2012-08-06 18:27 xleroy Status assigned => acknowledged
2012-08-06 22:54 frisch Note Added: 0007923
2013-07-29 15:32 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 15:39 doligez Tag Attached: recmod
2014-07-31 15:43 doligez Target Version 4.02.0+dev => 4.03.0+dev / +beta1
2016-03-25 13:51 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:21 garrigue Note Added: 0017641
2017-03-14 09:21 garrigue Severity minor => feature
2017-03-14 09:21 garrigue Target Version undecided => later
2017-03-14 09:40 frisch Note Added: 0017642
2017-03-14 10:36 garrigue Note Added: 0017644


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker