Skip to content
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

Recursive modules which do not type #4829

Closed
vicuna opened this issue Jun 22, 2009 · 2 comments
Closed

Recursive modules which do not type #4829

vicuna opened this issue Jun 22, 2009 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Jun 22, 2009

Original bug ID: 4829
Reporter: Etienne Millon
Status: acknowledged (set by @xavierleroy on 2012-08-06T16:25:28Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.11.1+rc1
Target version: undecided
Category: typing
Tags: recmod
Monitored by: "Etienne Millon" @jberdine

Bug description

Here is a piece of code with recursive modules that does not type :

module type BSig =
sig
  type t
  val f: t -> unit
end

module type ASig = functor(B: BSig) ->
sig
  type t
  val g: B.t -> unit
end

module Make(C: BSig) =
struct
  type t = int
  let g _ = ()
end

module MakeA = (Make: ASig)

module rec A:
sig
  type t
  val g: B.t -> unit
end
= MakeA(B)

and B:
sig
  type t = int * A.t
  val f: t -> unit
end
=
struct
  type t = int * A.t

  let f x = A.g x   (* does not type *)
(*
  let f (a, b) = A.g (a, b)   (* types correctly *)
 *)
end

Note that if function f is replaced by the commented version, then the type
checker succeeds. Even though, this code modification is only giving the
additional information that the argument of f is a pair.

Additional information

This code used to compile with Ocaml 3.10.0 but does not with 3.10.2 and 3.11.1

@vicuna
Copy link
Author

vicuna commented Aug 6, 2012

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.

@github-actions
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants