New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typing problem with recursive modules #5006
Comments
Comment author: @xavierleroy I've been sleeping on these PR for too long, and still have no idea how to address them. Unassigning them from myself. |
Comment author: @alainfrisch 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? |
Comment author: @garrigue There is no specification of recursive modules, so this is not a bug :-) |
Comment author: @alainfrisch 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. |
Comment author: @garrigue 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. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Original bug ID: 5006
Reporter: @alainfrisch
Status: acknowledged (set by @xavierleroy on 2012-08-06T16:27:00Z)
Resolution: open
Priority: normal
Severity: feature
Target version: later
Category: typing
Tags: recmod
Monitored by: @jberdine "Julien Signoles" @yakobowski
Bug description
The 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?
The text was updated successfully, but these errors were encountered: