From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 645607ED27 for ; Wed, 30 May 2012 02:26:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAIVoxU/RVdI2imdsb2JhbABEhUGvcAgiAQEBCgkNBxIGI4IwAg8dARseAxIQNwIEIAERAQUBFgw1h1oBAwuYLIJeCQOLW1CCcIR+ChknDVeIcQEFDI8ngRIDjjSBHYVGjhU9hBs X-IronPort-AV: E=Sophos;i="4.75,681,1330902000"; d="ml'?sh'?gz'50?mli'50?scan'50,208,49,50";a="160471286" Received: from mail-pz0-f54.google.com ([209.85.210.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 30 May 2012 02:26:24 +0200 Received: by dadv36 with SMTP id v36so7819714dad.27 for ; Tue, 29 May 2012 17:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=6KkM0JXm1D3uJbA8SQ3qy4Qh5fjEH+4kfycGHPUSDN0=; b=fwszI8948i+SSN/h6KZ6q+Tj4AeRm1Nc0sj4nggeWXCg4//IB/Ktudfy0NFLKYuGXT RFN8SUkdaztFuGCJCVAs/CT3Tyx5iQTxM3EnxidS7CxOFtDUjPPAcMM2lDfA7VxAJZCd WdaGxrg2fEc6bu6lOPlUkbC1fmEfES4ApHMCvNuDChxBYv8DnRQHCz/R0AefC3JMUx0U zL6SY2qjhMDbFy1gwmoNmiJmV4A4BhIOFNH//ybVtjdCkCLtfOH5V64zCGOjLLx5D7Xs YEMELWpQuOhBGSViaujLHjpOvaNio8CU5IBHTtAuuSH8du1xZac80aMmRFGn1VVfKkiV MdHw== Received: by 10.68.238.228 with SMTP id vn4mr42988239pbc.132.1338337577989; Tue, 29 May 2012 17:26:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.55.36 with HTTP; Tue, 29 May 2012 17:25:20 -0700 (PDT) From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Date: Tue, 29 May 2012 20:25:20 -0400 Message-ID: To: Caml List Content-Type: multipart/mixed; boundary=047d7b33d950ecf6a904c135ff50 Subject: [Caml-list] strange error with packed modules and module type of --047d7b33d950ecf6a904c135ff50 Content-Type: text/plain; charset=UTF-8 I'm playing with specifying interfaces for packed modules. Afaik, when compiling library lib, if there is a file lib.mli, compiler will check whether library obeys the interface in lib.cmi and then use that as the interface for the library, otherwise the interface will be inferred. This is what I have. foo.ml: type t = int let x = 5 foo.mli: type t val x : t g.mli: module Foo : sig include module type of Foo end and I compile the library G like this: ocamlopt.opt -for-pack G -c foo.mli foo.ml ocamlopt.opt -c g.mli ocamlopt.opt -pack -o g.cmx foo.cmx No problems, everything works. Now I want to get fancy and I add std.ml, and change g.mli (code included as packed.tar.gz) std.ml: module Foo = Foo g.mli: module Std : sig include module type of Std end and compile similarly like before ocamlopt.opt -for-pack G -c foo.mli foo.ml ocamlopt.opt -for-pack G -c foo.cmx std.ml ocamlopt.opt -c g.mli ocamlopt.opt -pack -o g.cmx foo.cmx std.cmx But now I get this helpful error message File "g.cmx", line 1, characters 0-1: Error: The implementation (obtained by packing) does not match the interface g.mli: Modules do not match: sig module Foo : sig type t = Foo.t val x : t end end is not included in sig module Foo : sig type t = Foo.t val x : t end end Modules do not match: sig type t = Foo.t val x : t end is not included in sig type t = Foo.t val x : t end Type declarations do not match: type t = Foo.t is not included in type t = Foo.t Does anyone know what is going on here? Thanks, Milan --047d7b33d950ecf6a904c135ff50 Content-Type: application/x-gzip; name="packed.tar.gz" Content-Disposition: attachment; filename="packed.tar.gz" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h2tnkhv70 H4sIAJ1nxU8AA+2X0W6DIBRAffYr7rK3JlpQ0WRJX7cP2BdY1NZOxFVsur/f Fd26NFvaF92y3pMI6AXh5cCl0NpXVelMCUPiOHIY5yyMhH1PEm5rS8AdzpOY B3EgEoxjgwcOsElXNdK1Jt0DOArrWu/yQym/7ffapbWZY0HzYt6aHIx7SCs4 wgO2fntBxKwU1v9p57jsf/Lpf8x4738UCvJ/Dgb/YQVlbdwqN7gLrEDQLnAr tCb7A/6fzn88+a3/ESP/50DprKtyeNQavceSzL8tNpNn/1f4H7MP/0PBkt7/ QETk/xyM/j+bDLP/ttxgHiCrLsthDNj8QBe2Q15ntD38M6RWTVnlfrudbo7B d/Gj/6j96f7fx3kYBnT+z8I93C3XZb1cp+3WdfcKFr5UCyy1q2WqKt0YHx/w Cr33mlS+wBN4EoZrYznWF7tKdYQh0zzrKsEeQGdf7WBPY6wf+PUHWNMWRBAE QRAEQRAEQRAEQRAEcQ3vMwOy2gAoAAA= --047d7b33d950ecf6a904c135ff50--