Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000296OCamlOCaml generalpublic2001-02-27 17:592001-03-05 14:04
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000296: In order to make it perfect...
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 [^]

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000517)
administrator (administrator)
2001-03-05 14:03

> # 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

(0000518)
administrator (administrator)
2001-03-05 14:04

Fixed 2001-05-03 by XL

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker