Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Chris King" <colanderman@gmail.com>
To: "Caml List" <caml-list@inria.fr>
Subject: Oddness concerning private variants in 3.10.0
Date: Fri, 7 Sep 2007 17:04:33 -0400	[thread overview]
Message-ID: <875c7e070709071404q641d0ec0rbacbb07763a5a4bb@mail.gmail.com> (raw)

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


             reply	other threads:[~2007-09-07 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-07 21:04 Chris King [this message]
2007-09-08  0:04 ` [Caml-list] " Jacques GARRIGUE
2007-09-08  4:56   ` Chris King
2007-09-09  3:13 ` Chris King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875c7e070709071404q641d0ec0rbacbb07763a5a4bb@mail.gmail.com \
    --to=colanderman@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox