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

In order to make it perfect... #2693

Closed
vicuna opened this issue Feb 27, 2001 · 2 comments
Closed

In order to make it perfect... #2693

vicuna opened this issue Feb 27, 2001 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Feb 27, 2001

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

@vicuna
Copy link
Author

vicuna commented Mar 5, 2001

Comment author: administrator

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 :-)

Thanks for the bug report.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Mar 5, 2001

Comment author: administrator

Fixed 2001-05-03 by XL

@vicuna vicuna closed this as completed Mar 5, 2001
@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