caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Benedikt Grundmann <benedikt.grundmann@googlemail.com>
To: OCaml <caml-list@inria.fr>
Subject: Bug with include and module types ?
Date: Tue, 10 Mar 2009 10:48:13 +0000	[thread overview]
Message-ID: <9b415f950903100348n3fbe6803j970459cd535b8186@mail.gmail.com> (raw)

Hi list,

I stumbled across something which I believe to be a bug in the ocaml
module type language:

        Objective Caml version 3.11.0

#  module type S = sig val foo : string -> string -> int val bar :
string -> string end;;
module type S =
  sig val foo : string -> string -> int val bar : string -> string end
# module type B = sig include S val foo : string -> int end;;
module type B =
  sig
    val foo : string -> string -> int
    val bar : string -> string
    val foo : string -> int
  end
#

Observe that if you do the same thing in the module language, the
behavior is different
(imho correct) and foo is shadowed:

# module S = struct let foo x y = 1 let bar s = s end ;;
module S : sig val foo : 'a -> 'b -> int val bar : 'a -> 'a end
# module B = struct include S let foo x = 1 end;;
module B : sig val bar : 'a -> 'a val foo : 'a -> int end

Cheers,

Bene

-- 
Calvin: I try to make everyone's day a little more
surreal.

(From Calvin & Hobbes)


                 reply	other threads:[~2009-03-10 10:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=9b415f950903100348n3fbe6803j970459cd535b8186@mail.gmail.com \
    --to=benedikt.grundmann@googlemail.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;
as well as URLs for NNTP newsgroup(s).