caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Philippe Veber <philippe.veber@gmail.com>
To: caml users <caml-list@inria.fr>
Subject: [Caml-list] Unwanted type constraint in mutually recursive parameterized class type definition.
Date: Wed, 8 Jul 2015 18:24:39 +0200	[thread overview]
Message-ID: <CAOOOohSwhQ7GwHHh--VJ0A4uKOVpqn8NzCUhW-5E3BkX5PGV6Q@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Dear camlers,

  I obtain an unexpected answer from the toplevel when I enter the
following definition:

        OCaml version 4.03.0+dev7-2015-02-08

# class type ['a] c =
  object
    method m : d
  end
and d =
  object
    inherit [int] c
  end
;;
class type ['a] c = object constraint 'a = int method m : d end
and d = object method m : d end

What surprises me is the constraint 'a = int in the definition of c. Is
this is a bug or feature?

Cheers,
  Philippe.

[-- Attachment #2: Type: text/html, Size: 692 bytes --]

             reply	other threads:[~2015-07-08 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 16:24 Philippe Veber [this message]
2015-07-08 23:57 ` Jacques Garrigue
2015-07-16 16:00   ` Philippe Veber

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=CAOOOohSwhQ7GwHHh--VJ0A4uKOVpqn8NzCUhW-5E3BkX5PGV6Q@mail.gmail.com \
    --to=philippe.veber@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;
as well as URLs for NNTP newsgroup(s).