caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: David Allsopp <dra-news@metastack.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] "type foo = Foo | Bar | Baz" vs. "type foo = Foo | Baz | Bar"
Date: Thu, 10 Mar 2016 21:59:04 +0100	[thread overview]
Message-ID: <20160310215904.Horde.8tVDFl6XFFn2wZIOypn5GPj@webmail.in-berlin.de> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9EA34D002@Remus.metastack.local>


Zitat von David Allsopp <dra-news@metastack.com> (Thu, 10 Mar 2016  
19:50:34 +0000)

> Oliver Bandel wrote:
>> Hello,
>>
>> I got an error message when the ml-file and the mli-file have a sum-type,
>> where the order of the type definitionis different.
>> This seems to be new, at least I did not found such an error message
>> before.
>>
>> ==========================================================================
>> =
>> File "foo.ml", line 1:
>> Error: The implementation foo.ml does not match the interface foo.cmi:
>>         Type declarations do not match:
>>           type foo = Foo | Bar | Baz
>>         is not included in
>>           type foo = Foo | Baz | Bar
>>         File "foo.ml", line 1, characters 0-26: Actual declaration
>>         Fields number 2 have different names, Bar and Baz.
>> ==========================================================================
>> =
>
> It has always been the case, but I think the error message used to  
> be much less clear.

Hmhhh, maybe I just did not changed the order before.
(I often used  ocamlc -i to generate mli-files and then removed the  
unneeded stuff from them,
so I didn't changed the order.)


>
>> I looked for warning-/error-codes, to look, if checking the order of the
>> definition of a type can be switched on and off.
>>
>> But I didn't found a number, that I can use with -w-switch.
>
> It's not a warning, so you can't switch it off - having a different  
> order of constructors makes the type different (it changes the  
> runtime representation).
[...]

OK, thanks for the explanation.


Ciao,
    Oliver


      reply	other threads:[~2016-03-10 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10 19:47 Oliver Bandel
2016-03-10 19:50 ` David Allsopp
2016-03-10 20:59   ` Oliver Bandel [this message]

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=20160310215904.Horde.8tVDFl6XFFn2wZIOypn5GPj@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.com \
    /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;
as well as URLs for NNTP newsgroup(s).