From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id B1EF5BC37 for ; Tue, 27 Oct 2009 10:04:58 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao4BAB1V5kqArkR3kWdsb2JhbACbPAEBAQEJCwoHEwStMYYxiEyEPwQ X-IronPort-AV: E=Sophos;i="4.44,632,1249250400"; d="scan'208";a="37061128" Received: from dscas1.ad.uiuc.edu ([128.174.68.119]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-MD5; 27 Oct 2009 10:04:29 +0100 Received: from [10.0.1.6] (70.225.165.4) by exchange.cites.uiuc.edu (128.174.68.9) with Microsoft SMTP Server (TLS) id 8.1.358.0; Tue, 27 Oct 2009 04:04:27 -0500 Message-ID: <0F014A8A-B238-4809-A3A7-D765CB739D26@illinois.edu> From: Brighten Godfrey To: OCaml List Content-Type: text/plain; charset="US-ASCII"; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit MIME-Version: 1.0 (Apple Message framework v936) Subject: Ocaml 3.09.3 --> 3.11.0 breaks this Date: Tue, 27 Oct 2009 04:04:26 -0500 X-Mailer: Apple Mail (2.936) X-Spam: no; 0.00; ocaml:01 recompile:01 ocaml:01 compiler:01 wrote:01 compile:01 compile:01 complains:01 compiles:01 inherit:01 int:01 expression:02 expression:02 breaks:02 size:95 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