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

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).