Browse thread
RFH: Values do not match: val bar1 : Foo.foo_t is not included in val bar1 : Foo.foo_t
-
Goswin von Brederlow
-
Julien Signoles
- Goswin von Brederlow
-
Julien Signoles
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Goswin von Brederlow <goswin-v-b@w...> |
| Subject: | Re: [Caml-list] RFH: Values do not match: val bar1 : Foo.foo_t is not included in val bar1 : Foo.foo_t |
Julien Signoles <julien.signoles@gmail.com> writes:
> 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
That sounds like a bug then.
I was trying hard not to repeat information in different places. That
just ends up with one of them getting out of sync.
MfG
Goswin