From: Manuel Fahndrich <maf@microsoft.com>
To: "CAML List (E-mail)" <caml-list@inria.fr>
Subject: Signature matching question?
Date: Thu, 11 Feb 1999 17:47:39 -0800 [thread overview]
Message-ID: <25983782061AD111B0800000F86310FE1026CAFD@RED-MSG-42> (raw)
I've run into the following problem with signature matching.
Consider the following module type and module definitions:
module type FOO =
sig
type bar
module A :
sig
val fresh : unit -> bar
end
end
module Foo : FOO =
struct
module A =
struct
type t = {foo: int}
let fresh () = {foo=1}
end
type bar = A.t
end
ocamlc -i test.ml
File "test.ml", line 19, characters 2-133:
Signature mismatch:
Modules do not match:
sig
module A : sig type t = { foo: int } val fresh : unit -> t end
type bar = A.t
end
is not included in
FOO
Modules do not match:
sig type t = { foo: int } val fresh : unit -> t end
is not included in
sig val fresh : unit -> bar end
Values do not match:
val fresh : unit -> t
is not included in
val fresh : unit -> bar
Is this intended behavior, or a bug? I would assume that within a module,
delcarations are treated as an unordered set.
Thus, the compiler should first find all type equivalences before matching
individual types.
-Manuel
next reply other threads:[~1999-02-12 8:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-12 1:47 Manuel Fahndrich [this message]
1999-02-19 15:29 ` Xavier Leroy
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=25983782061AD111B0800000F86310FE1026CAFD@RED-MSG-42 \
--to=maf@microsoft.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