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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 67A7E7ED26 for ; Wed, 30 May 2012 04:30:20 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgwCAFyFxU9KfVK2kGdsb2JhbABEhUGvcggiAQEBAQkJDQcUBCOCFwEBAQMBEgIPHQEbHQEDAQsGAwILDQICJgICIQEBEQEFARwGEyKHWgEDBgWbCgkDi1tQgnCFBAoZJw1XiHEBBQyBGIh9YoQwgRIDlReKd4MePYQb X-IronPort-AV: E=Sophos;i="4.75,681,1330902000"; d="scan'208";a="145837949" Received: from mail-we0-f182.google.com ([74.125.82.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 May 2012 04:30:19 +0200 Received: by werg1 with SMTP id g1so5131630wer.27 for ; Tue, 29 May 2012 19:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4dHHqsZQNO7SqlWb3/14eI+ub1Dl7gghWyAplmCn1iI=; b=QkszEh6a0XDQzO2/qktqOBtaVgsWc2QIyfnzf1+QxRarEkcOotZ50uI4q/vQl12655 gTnDcEoQoyrMVUfwOe+wCkG7/Uh0pD/StAiR0a5dAXIAmQ0JBhwLEmB9vRLcqA+HLel1 Eb9Eb9sGPW04MTHFaObqJqS8CeNsaV0o2aCDdkmHWnXEYdmyu8zPTJoyriEiUtdyeURl fq84nw2+QAZ3t85U+6DG1/frEESacfZrfNTXOo0G2R3msQzBcqdC1q2zt9VmnTx4fRZ5 s7/R2tufCfpN767QyYSAkfDfpcbFk+/t/QEDV2grQUTzU7DGTpWabgwlC61KYGJ6qogY ZPEA== MIME-Version: 1.0 Received: by 10.216.194.23 with SMTP id l23mr4118280wen.121.1338345016005; Tue, 29 May 2012 19:30:16 -0700 (PDT) Received: by 10.180.96.35 with HTTP; Tue, 29 May 2012 19:30:15 -0700 (PDT) In-Reply-To: References: Date: Tue, 29 May 2012 22:30:15 -0400 Message-ID: From: Markus Mottl To: =?ISO-8859-2?Q?Milan_Stanojevi=E6?= Cc: Caml List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] strange error with packed modules and module type of On Tue, May 29, 2012 at 8:25 PM, Milan Stanojevi=C4=87 = wrote: > g.mli: > module Std : sig include module type of Std end Btw., this is equivalent and slightly shorter: module Std : module type of Std > 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 [snip] > Does anyone know what is going on here? This seemingly identical construction compiles: g.mli: module Std : sig module Foo : module type of Foo end I guess this also points to what is going wrong. If I understand this correctly, the workaround basically says: "Std contains a submodule Foo which just happens to have the same signature as the module implemented by foo.ml". But the broken version says: "Std contains a submodule Foo which is equivalent to the module implemented by foo.ml". This equivalence is somehow lost with packing, hence the unhelpful error message. Not sure, but I guess this can be fixed in the compiler? Regards, Markus --=20 Markus Mottl=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.ocaml.info=C2=A0 =C2=A0 = =C2=A0 =C2=A0 markus.mottl@gmail.com