Version française
Home     About     Download     Resources     Contact us    
Browse thread
RFH: Values do not match: val bar1 : Foo.foo_t is not included in val bar1 : Foo.foo_t
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Julien Signoles <julien.signoles@g...>
Subject: Re: [Caml-list] RFH: Values do not match: val bar1 : Foo.foo_t is not included in val bar1 : Foo.foo_t
Hello,

2010/5/24 Goswin von Brederlow <goswin-v-b@web.de>

> I'm playing around with packs and ways to avoid having to duplicate
> module signatures all over the place. So I came up with the following
> idea: Each module declares an external and internal module type and
> restricts itself to the internal type. The pack then further restricts
> the module to the external type.
>
> But then I get a type error I can't make heads or tails of:


> File "pack.cmx", line 1, characters 0-1:
> Error: The implementation (obtained by packing)
>       does not match the interface pack.mli:
>       Modules do not match:
>         sig
>           module type Extern = sig val bar1 : Foo.foo_t end
>           module type Intern =
>             sig val bar1 : Foo.foo_t val bar2 : Foo.foo_t end
>           module I : sig val bar1 : Foo.foo_t val bar2 : Foo.foo_t end
>           val bar1 : Foo.foo_t
>           val bar2 : Foo.foo_t
>         end
>       is not included in
>         sig val bar1 : Foo.foo_t end
>       Values do not match:
>         val bar1 : Foo.foo_t
>       is not included in
>         val bar1 : Foo.foo_t
> make: *** [all] Error 2


>
> Can anyone explain that to me?
>

The error message is not very helpful here. But don't refer to an internal
generative type (namely Foo.foo_t) in your packing signature pack.mli. To
solve your issue, you have to declare the type foo_t outside the pack like I
said in a previous message (
http://caml.inria.fr/pub/ml-archives/caml-list/2010/05/b79d812d9dfb99e12c8e924f83d7168c.en.html
).

Hope this helps,
Julien