caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: khooyp@cs.umd.edu
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Problem with class method and polymorphic variants
Date: Wed, 25 Jun 2008 12:12:26 +0900 (JST)	[thread overview]
Message-ID: <20080625.121226.240480867.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <9CA92F89-880D-46A8-835C-F4E93722BEE2@cs.umd.edu>

From: Khoo Yit Phang <khooyp@cs.umd.edu>
> Hi,
> 
> I discovered that the attached snippet of Ocaml does not compile in  
> ocamlc, but does work in the ocaml toplevel (tested in v3.10.0 and  
> 3.10.2). Removing anything (except the :int annotation) causes the  
> error to go away. Is it a bug in the type-checker?
> 
> # cat polymorphic-variants-methods-bug.ml
> class ['a] c (a : 'a) =
>     object (s)
>         method s = s
>         method d : int = match a with `A b -> b#num
>     end

Of course this is a bug. I added it myself to the bug tracker.
By the way you could also trigger it in the toplevel by giving
explicitly a module signature (this is what ocamlc does internally).

This is now fixed in CVS, branch release310.
Note that you may still have other kinds of problems using
upper-bounded polymorpic variants inside constraints. Just report them
as you go...

Cheers,

Jacques Garrigue


  reply	other threads:[~2008-06-25  3:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-24 18:17 Khoo Yit Phang
2008-06-25  3:12 ` Jacques Garrigue [this message]
2008-06-25  5:17   ` [Caml-list] " Khoo Yit Phang
2008-06-26  2:46     ` Jacques Garrigue

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=20080625.121226.240480867.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=khooyp@cs.umd.edu \
    /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).