caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Oddness concerning private variants in 3.10.0
@ 2007-09-07 21:04 Chris King
  2007-09-08  0:04 ` [Caml-list] " Jacques GARRIGUE
  2007-09-09  3:13 ` Chris King
  0 siblings, 2 replies; 4+ messages in thread
From: Chris King @ 2007-09-07 21:04 UTC (permalink / raw)
  To: Caml List

Hi,

I just took the leap to 3.10 and encountered some strangeness
compiling my project with it:

The implementation input_test.ml
does not match the interface (inferred signature):
Type declarations do not match:
  type button = FrGui.button
is not included in
  type button = FrGui.button#row

First, I don't understand how a module doesn't match its inferred
signature.  Strangely, creating a blank input_test.mli file gets
around this error.

Second, the type button (which is a private variant) isn't even
defined in input_test.ml, it's defined in a module opened by it.

I tried coming up with some minimal test cases and found even more
interesting results:

Compiling this:

module A: sig
  type t = [ `A | `B ]
end = struct
  type t = private [> `A ]
end

results in the error:

Type declarations do not match:
  type t = private [> `A ]
is not included in
  type t = [ `A | `B ]

But compiling this:

type t = [ `A | `B ]

with this .mli file:

type t = private [> `A ]

works fine.  What is going on here?

I haven't yet been able to reproduce the error in my project using a
minimal test case but I will post it when I do.

Thanks,
Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Oddness concerning private variants in 3.10.0
  2007-09-07 21:04 Oddness concerning private variants in 3.10.0 Chris King
@ 2007-09-08  0:04 ` Jacques GARRIGUE
  2007-09-08  4:56   ` Chris King
  2007-09-09  3:13 ` Chris King
  1 sibling, 1 reply; 4+ messages in thread
From: Jacques GARRIGUE @ 2007-09-08  0:04 UTC (permalink / raw)
  To: colanderman; +Cc: caml-list

From: "Chris King" <colanderman@gmail.com>
> I just took the leap to 3.10 and encountered some strangeness
> compiling my project with it:
> 
> The implementation input_test.ml
> does not match the interface (inferred signature):
> Type declarations do not match:
>   type button = FrGui.button
> is not included in
>   type button = FrGui.button#row
> 
> First, I don't understand how a module doesn't match its inferred
> signature.  Strangely, creating a blank input_test.mli file gets
> around this error.

This looks like a bug report, but I clearly miss information to solve it.

> Compiling this:
> 
> module A: sig
>   type t = [ `A | `B ]
> end = struct
>   type t = private [> `A ]
> end
> 
> results in the error:

It certainly should: here the signature is written first!
If you write it the other way round, it is accepted without problem.

Concerning your first problem, could you submit a bu report, attaching
relevant information?

Jacques Garrigue


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Oddness concerning private variants in 3.10.0
  2007-09-08  0:04 ` [Caml-list] " Jacques GARRIGUE
@ 2007-09-08  4:56   ` Chris King
  0 siblings, 0 replies; 4+ messages in thread
From: Chris King @ 2007-09-08  4:56 UTC (permalink / raw)
  To: Jacques GARRIGUE; +Cc: caml-list

On 9/7/07, Jacques GARRIGUE <garrigue@math.nagoya-u.ac.jp> wrote:
> From: "Chris King" <colanderman@gmail.com>
> > Compiling this:
> >
> > module A: sig
> >   type t = [ `A | `B ]
> > end = struct
> >   type t = private [> `A ]
> > end
> >
> > results in the error:
>
> It certainly should: here the signature is written first!
> If you write it the other way round, it is accepted without problem.

D'oh!  Braino on my part.  You are right, I did mean the other way around.

> Concerning your first problem, could you submit a bu report, attaching
> relevant information?

Sure... I will try to come up with a smaller program to reproduce it
first though.

- Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Oddness concerning private variants in 3.10.0
  2007-09-07 21:04 Oddness concerning private variants in 3.10.0 Chris King
  2007-09-08  0:04 ` [Caml-list] " Jacques GARRIGUE
@ 2007-09-09  3:13 ` Chris King
  1 sibling, 0 replies; 4+ messages in thread
From: Chris King @ 2007-09-09  3:13 UTC (permalink / raw)
  To: Caml List

On 9/7/07, Chris King <colanderman@gmail.com> wrote:
> Second, the type button (which is a private variant) isn't even
> defined in input_test.ml, it's defined in a module opened by it.

Another braino on my part... input_test.ml does actually include the
module defining type button.

The core of the bug remains however, and a bug report (#4383) has been filed.

- Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-09  3:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-07 21:04 Oddness concerning private variants in 3.10.0 Chris King
2007-09-08  0:04 ` [Caml-list] " Jacques GARRIGUE
2007-09-08  4:56   ` Chris King
2007-09-09  3:13 ` Chris King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).