caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brighten Godfrey <pbg@illinois.edu>
To: OCaml List <caml-list@yquem.inria.fr>
Subject: Ocaml 3.09.3 --> 3.11.0 breaks this
Date: Tue, 27 Oct 2009 04:04:26 -0500	[thread overview]
Message-ID: <0F014A8A-B238-4809-A3A7-D765CB739D26@illinois.edu> (raw)

Hello list,

I went to recompile some software I wrote, after installing OCaml  
3.11.0, and it won't compile.  Specifically the following code snippet  
compiles in OCaml 3.09.3:

     class virtual c1 = object(self)
         end

     class virtual c2 = object(self)
         inherit c1

         method virtual stuff: c2 list

         method contents: c1 list =
             (self#stuff :> c1 list)

         method size: int =
              List.fold_right (fun (c:c2) sum ->
                 (c#size) + sum) (self#stuff) 0
         end

Yet in 3.11.0, the compiler complains:

     File "test.ml", line 14, characters 10-11:
     Error: This expression has type c2
            It has no method size

The expression in question is the variable `c' in the expression  
`c#size'.  Note that removing the method `contents', which is not used  
anywhere, or having `contents' just return [], causes it to compile  
without error.

Any thoughts?

Thanks,
~Brighten Godfrey


             reply	other threads:[~2009-10-27  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27  9:04 Brighten Godfrey [this message]
2009-10-27  9:45 ` [Caml-list] " Stéphane Glondu
2009-10-28  2:24   ` Brighten Godfrey

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=0F014A8A-B238-4809-A3A7-D765CB739D26@illinois.edu \
    --to=pbg@illinois.edu \
    --cc=caml-list@yquem.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).