From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA21178 for caml-redistribution; Fri, 12 Feb 1999 09:31:05 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA04327 for ; Fri, 12 Feb 1999 02:48:07 +0100 (MET) Received: from mail5.microsoft.com (mail5.microsoft.com [131.107.3.121]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id CAA15201 for ; Fri, 12 Feb 1999 02:48:05 +0100 (MET) Received: by INET-IMC-05 with Internet Mail Service (5.5.2524.0) id <1WGT33QW>; Thu, 11 Feb 1999 17:48:06 -0800 Message-ID: <25983782061AD111B0800000F86310FE1026CAFD@RED-MSG-42> From: Manuel Fahndrich To: "CAML List (E-mail)" Subject: Signature matching question? Date: Thu, 11 Feb 1999 17:47:39 -0800 X-Mailer: Internet Mail Service (5.5.2524.0) Sender: weis I've run into the following problem with signature matching. Consider the following module type and module definitions: module type FOO = sig type bar module A : sig val fresh : unit -> bar end end module Foo : FOO = struct module A = struct type t = {foo: int} let fresh () = {foo=1} end type bar = A.t end ocamlc -i test.ml File "test.ml", line 19, characters 2-133: Signature mismatch: Modules do not match: sig module A : sig type t = { foo: int } val fresh : unit -> t end type bar = A.t end is not included in FOO Modules do not match: sig type t = { foo: int } val fresh : unit -> t end is not included in sig val fresh : unit -> bar end Values do not match: val fresh : unit -> t is not included in val fresh : unit -> bar Is this intended behavior, or a bug? I would assume that within a module, delcarations are treated as an unordered set. Thus, the compiler should first find all type equivalences before matching individual types. -Manuel