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

typing bug in module alias #3546

Closed
vicuna opened this issue Mar 17, 2005 · 1 comment
Closed

typing bug in module alias #3546

vicuna opened this issue Mar 17, 2005 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Mar 17, 2005

Original bug ID: 3546
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Daniel Weil
Version: 3.08
OS: Windows
Submission from: 62.39.121.226 (62.39.121.226)

I resubmit the bug (seems it was lost last week!)

I have a strange behavior which seems related to the fact that I use a functor
application in which a record definition is made, then a module alias to this
application.
The OCaml compiler does not known that the obj in Obj' is equal to the type obj
in module Obj!!
ANd the bug dissapear if I replace the definition of type attr by the definition
which is put in comment below.

Here is the example :

module Make = functor (X: sig
type 'a t
type 'a content
end) ->
struct

(* type attr = (string option) X.content*)
type attr = {a : (string option) X.content}
type obj = attr X.t
end

module Obj = struct
module M = struct
type 'a t = 'a
type 'a content = 'a list
end
module Mmodel = Make (M)
include Mmodel
end

module Bidule = struct
module Obj' = Obj
module Common :sig
val f : Obj'.obj -> Obj'.obj
end = struct
let f x = (x:Obj.obj)
end

end

@vicuna
Copy link
Author

vicuna commented Jul 29, 2005

Comment author: administrator

see also #3539. This boils down to the fact that F(M).t and F(M').t are
different types even though M' is defined as module M' = M. There is no
structure equality in type paths. Unnatural, but unlikely to be ever addressed.
XL, 2007-07-29.

@vicuna vicuna closed this as completed Jul 29, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant