You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 296 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi!
There is a little bug in duplicate names checking of module type
definitions:
module type W = sig type t type t end;;
Multiple definition of the type name t.
Names must be unique in a given structure or signature.
==> ok
module type W = sig module M : sig end module M : sig end end;;
Multiple definition of the module type name M.
Names must be unique in a given structure or signature.
==> should be "module name M"
module type W = sig module type S module type S end;;
module type W = sig module type S module type S end
==> should not be accepted like in:
module M = struct module type S=sig end module type S=sig end end;;
Multiple definition of the module type name S.
Names must be unique in a given structure or signature.
I tested it with 3.00 but that part of code (the function
transl_signature in typing/typemod.ml) has not changed since.
And I have a question by the way, what is the point of acceping this
module type:
module type W = sig val x: int val x : string end;;
module type W = sig val x : int val x : string end
if no modules can be (succesfully :) matched against it?
Jacek
Laboratoire de Recherche en Informatique (LRI) - Equipe DEMONS
batiment 490, bureau 95, Universite Paris-Sud 91405 ORSAY (FRANCE)
tel:33.1.69.15.64.53 - fax:33.1.69.15.65.86 - http://www.lri.fr/~jacek
The text was updated successfully, but these errors were encountered:
module type W = sig module M : sig end module M : sig end end;;
Multiple definition of the module type name M.
Names must be unique in a given structure or signature.
==> should be "module name M"
Right.
module type W = sig module type S module type S end;;
module type W = sig module type S module type S end
==> should not be accepted like in:
Right as well. I fixed / added the corresponding checks.
And I have a question by the way, what is the point of acceping this
module type:
module type W = sig val x: int val x : string end;;
module type W = sig val x : int val x : string end
if no modules can be (succesfully :) matched against it?
Currently, we only check duplicate names that could induce typing
inconsistencies, i.e. types, module types, and modules (via their type
and module type components). A duplicate value name makes the
signature unsatisfiable, but does not introduce typing
inconsistencies. I guess the answer to your question is that we could
reject W above, but we've been too lazy to implement the corresponding
checks :-)
Original bug ID: 296
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi!
There is a little bug in duplicate names checking of module type
definitions:
module type W = sig type t type t end;;
Multiple definition of the type name t.
Names must be unique in a given structure or signature.
==> ok
module type W = sig module M : sig end module M : sig end end;;
Multiple definition of the module type name M.
Names must be unique in a given structure or signature.
==> should be "module name M"
module type W = sig module type S module type S end;;
module type W = sig module type S module type S end
==> should not be accepted like in:
module M = struct module type S=sig end module type S=sig end end;;
Multiple definition of the module type name S.
Names must be unique in a given structure or signature.
I tested it with 3.00 but that part of code (the function
transl_signature in typing/typemod.ml) has not changed since.
And I have a question by the way, what is the point of acceping this
module type:
module type W = sig val x: int val x : string end;;
module type W = sig val x : int val x : string end
if no modules can be (succesfully :) matched against it?
Jacek
Laboratoire de Recherche en Informatique (LRI) - Equipe DEMONS
batiment 490, bureau 95, Universite Paris-Sud 91405 ORSAY (FRANCE)
tel:33.1.69.15.64.53 - fax:33.1.69.15.65.86 - http://www.lri.fr/~jacek
The text was updated successfully, but these errors were encountered: